Which class elements are not persisted?



Which class elements are not persisted?..

Answer / Ashish Kumar Johri

In Hibernate, the following class elements are not persisted by default:
1. Transient variables - These are initialized only at runtime and their values are not stored in the database.
2. Static variables - These are shared among all instances of a class and their values are not specific to any object instance, hence they are not persisted.
3. Final variables - Once assigned, these variables cannot be changed during runtime. As such, final variables are initialized at compile-time and do not need to be stored in the database.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

What are the benefits of hibernatetemplate?

1 Answers  


What is difference between session get() and load() method in hibernate?

1 Answers  


What is one to many and many to many relationships one to many?

1 Answers  


How to update data in database using spring and hibernate?

1 Answers  


What is session object in hibernate?

1 Answers  


Which hibernate object wraps the jdbc connection?

1 Answers  


What are the configuration files in hibernate?

1 Answers  


Can we create multiple sessionfactory in hibernate?

1 Answers  


What is the role of session interface in hibernate?

1 Answers  


What is the need of hibernate tools when orm tools can be used?

1 Answers  


What is transaction management in hibernate?

1 Answers  


How to integrate Hibernate with Servlet or Struts2 web applications?

1 Answers  


Categories