If we would like to load just the mapping id for the mapped entity in some cases and whole entity in some cases, because we would like to lazily initialize the dependent entity in some case and not load the entity at all in some case, how can we accomplish that.<br /> <br /> For example -<br /> <br /> Employee entity is mapped to department entity through department id. We want that when we load employee.getDepartment().getDepartmentId(), it shouldn't load the complete department object but just the Id.
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers

 Q1. If we would like to load just the mapping id for the mapped entity in some cases and whole entity in some cases, because we would like to lazily initialize the dependent entity in some case and not load the entity at all in some case, how can we accomplish that.

For example -

Employee entity is mapped to department entity through department id. We want that when we load employee.getDepartment().getDepartmentId(), it shouldn't load the complete department object but just the Id.
Hibernate
Ans. a

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


Related Questions

  What is Lazy Initialization in Hibernate ?
  What are the ways to avoid LazyInitializationException ?
  Difference between first level and second level cache in hibernate ?
  Which annotations are used in Hibernate ?
  What are the contents of Hibernate configuration file ( hibernate.cfg.xml ) ?
  What things you would care about to improve the performance of Application if its identified that its DB communication that needs to be improved ?
  How to configure second level cache in Hibernate ?
  What is the use of @GeneratedValue annotation in Hibernate?
 What are the disadvantages of Hibernate over native APIs ?
  What are the advantages of Hibernate ?



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: