MappingException: composite-id class must implement Serializable

Asked on May 25, 2013
Hi all, help me for below error.

org.hibernate.MappingException: composite-id class must implement Serializable:
at org.hibernate.mapping.RootClass.checkCompositeIdentifier(
at org.hibernate.mapping.RootClass.validate(
at org.hibernate.cfg.Configuration.validate(
at org.hibernate.cfg.Configuration.buildSessionFactory(
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(

Replied on May 25, 2013
Your entity which is being associated with another entity, need to implement Serializable.
and define  private static final long serialVersionUID = 1L;

Write Answer

©2024 | Privacy Policy | Contact Us