Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7948429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:43:11+00:00 2026-06-04T01:43:11+00:00

I have a table with fields ID(primary key),Name and Address. how can i update

  • 0

I have a table with fields ID(primary key),Name and Address. how can i update the Name corrosponding to a particular ID,without loading that row from the table and then updating it. I want to be able to just specify the new Name value along with the corrosponding ID so that it would be done automatically. I have enabled autocommit.
an example code would be nice,as I’m new to hibernate and don’t wanna go deeply into createsession() and other things,just working on a project requiring quick and dirty solution 😀

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:43:13+00:00Added an answer on June 4, 2026 at 1:43 am

    using hql with your propertynames

    session.createQuery("UPDATE Entity set name=@p1 WHERE id=@p2")
        .setParameter("p1", "newname")
        .setParameter("p2", id)
        .executeUpdate();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose you have these tables: Table Name: Salesman Fields: S_ID(Primary Key), Name Table Name:
I have table with 4 primary key fields. I load that in to drop
I have a sql server table with 2 fields, ID (primary key) and Name
I have a table with 3 fields: ID (not unique, not primary key) timestamp
I have a table with the following fields: id VARCHAR(32) PRIMARY KEY, parent VARCHAR(32),
I have a table with fields id (primary key), name1, name2, and nicknames. Given
I have a Member Table with fields MemID - Primary Key Business_Name Business_Address Business_Phone
I have a table it has four fields : Phone_number(primary key),City_name,Category_product and sub_Category I
I have a database table called Genre with the following fields: Id (Seeded Primary
I have a table that has a composite key that consists of two int

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.