Reputation: 19
What is the use of implementing java.io.Serializable in Hibernate POJO Class?
Can we use any other mechanism instead of Serializable Class in Hibernate?
Upvotes: 0
Views: 934
Reputation: 66
You can refer to the below links for your answers:
When and why JPA entities should implement Serializable interface?
Do Hibernate table classes need to be Serializable?
Hibernate does not necessarily requires to implement Serializable, but the JPA 2.0 Specification says, if an entity is to be passed by value as a detached object, then the entity class must implement Serializable.
In hibernate wejust use it, because we write both HQL and native SQL queries in hibernate for database transactions. Hope you get your doubt cleared.
Upvotes: 1