# Do I still need to implement Serializable when using Hibernate?

**URL:** <https://discourse.hibernate.org/t/do-i-still-need-to-implement-serializable-when-using-hibernate/287>\
**Category:** Hibernate ORM\
**Created:** [February 26, 2018, 12:08pm UTC](https://discourse.hibernate.org/t/do-i-still-need-to-implement-serializable-when-using-hibernate/287 "2018-02-26T12:08:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Puplip](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@Puplip](https://discourse.hibernate.org/u/Puplip)\
**Post date:** [February 26, 2018, 12:08pm UTC](https://discourse.hibernate.org/t/do-i-still-need-to-implement-serializable-when-using-hibernate/287/1 "2018-02-26T12:08:42Z")

</div>

Do I still need to implement Serializable?  
What are the reasons for doing so in Hibernate?  
If I do so, how can it be exploited?

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [February 26, 2018, 12:12pm UTC](https://discourse.hibernate.org/t/do-i-still-need-to-implement-serializable-when-using-hibernate/287/2 "2018-02-26T12:12:07Z")

</div>

> Do I still need to implement Serializable?

For entities, no. It’s not needed by Hibernate.

Only for Embeddable Types you might want to implement Serializable, especially if they are used as @EmbeddedId.

> What are the reasons for doing so in Hibernate?

Because the id might be used as a key in the 2nd-level cache entries.

> If I do so, how can it be exploited?

An exploit is related to security and I’m not sure how Serializable might impact security. Try to elaborate.
