• +91 9723535972
  • info@interviewmaterial.com

Hibernate Interview Questions and Answers

Question - How can I create an association to an entity without fetching that entity from the database (if I know the identifier)?

Answer - If the entity is proxyable (lazy="true"), simply use load(). The following code does not result in any SELECT statement: Item itemProxy = (Item) session.load(Item.class, itemId);Bid bid = new Bid(user, amount, itemProxy);session.save(bid);

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners