DOM4J « Composite « JPA Q&A





1. DOM4J and composite-id : ClassXastException    forum.hibernate.org

Hibernate version: 3.2 Mapping documents: Code between sessionFactory.openSession() and session.close(): Session dom4jSession = session.getSession(EntityMode.DOM4J); Session pojoSession = session.getSession(EntityMode.POJO); Transaction ...

2. EntityMode.DOM4J problem with composite Id    forum.hibernate.org

I have a persistent object [code]@Entity @Table(name="RTSP_URL") @IdClass(KeyUrlRtsp.class) public class UrlRtsp implements Serializable { @Id @Column(name="DEVICE_ID") private Integer deviceId; @Id @Column(name="QUALITY_NAME") private String quality; ... }[/code] I serialized the an database Object out an XML file using the EntityMode.DOM4J, then tried to deserialize and insert the the dom4j element to the database. The composite key is not properly deserialized. The following ...

3. Problem with DOM4J persistence and composite keys    forum.hibernate.org

java.lang.ClassCastException: ch.legando.data.hibernate.CompositeKey at org.hibernate.property.Dom4jAccessor$ElementGetter.get(Dom4jAccessor.java:215) at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValue(AbstractComponentTuplizer.java:87) at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValues(AbstractComponentTuplizer.java:93) at org.hibernate.type.ComponentType.getPropertyValues(ComponentType.java:376) at org.hibernate.type.ComponentType.getHashCode(ComponentType.java:207) at org.hibernate.engine.EntityKey.generateHashCode(EntityKey.java:126) at org.hibernate.engine.EntityKey.(EntityKey.java:70) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:115) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:905) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:842) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:835