0
  1. What is the use of implementing java.io.Serializable in Hibernate POJO Class?

  2. Can we use any other mechanism instead of Serializable Class in Hibernate?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.