How to make an immutable class in hibernate?



How to make an immutable class in hibernate?..

Answer / Krishna Kumar

In Hibernate, you can make a class immutable by not providing any setter methods for the instance variables. Alternatively, you can use the JPA @Immutable annotation if your application is using JPA instead of Hibernate.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

How to prevent dirty checking in hibernate?

1 Answers  


Why do we need hibernate in java?

1 Answers  


Mention some of the databases that hibernate supports?

1 Answers  


What are the ways to access hibernate by using spring?

1 Answers  


Is session a thread-safe object?

1 Answers  


Why do we use inheritance mapping in hibernate?

1 Answers  


How create hibernate cfg xml in eclipse?

1 Answers  


What are the basic hibernate persistent annotations?

1 Answers  


What are the steps of calling a stored procedure in hibernate?

1 Answers  


What are native queries in hibernate?

1 Answers  


What is the root element for the hibernate mapping file?

1 Answers  


How to create two same tables in different schema’s by using single configuration file?

1 Answers  


Categories