2

Why a Hibernate persistence object in Java is marked serializable

asked Dec 2, 2010 at 6:31

2 Answers 2

2

Quoting Java Persistence with Hibernate:

Hibernate doesn’t require that persistent classes implement Serializable. However, when objects are stored in an HttpSession or passed by value using RMI, serialization is necessary. (This is likely to happen in a Hibernate application.)

answered Dec 2, 2010 at 6:39
Sign up to request clarification or add additional context in comments.

Comments

1

Because almost always your data objects crosses the machine that contains your data access code. So your objects should be serialized here and deserialized in distant machine to be used.

answered Dec 2, 2010 at 6:35

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.