The source:
Code:
@Entity(access=AccessType.FIELD)
public class Party {
@Id
String partyId;
@OneToOne(mappedBy="party")
PartyAffiliate partyAffiliate;
}
Code:
@Entity(access = AccessType.FIELD)
public class PartyAffiliate {
@Id
String partyId;
@OneToOne
@JoinColumn(name="partyId", referencedColumnName="partyId", insertable=false, updatable= false)
Party party;
String affiliateName;
}
Error:
Code:
16:23:16,195 INFO SessionFactoryImpl: building session factory
org.hibernate.MappingException: broken column mapping for: partyAffiliate.party of: org.ofbiz.oam.brokencolumn.Party
at org.hibernate.persister.entity.AbstractPropertyMapping.initPropertyPaths(AbstractPropertyMapping.java:122)
at org.hibernate.persister.entity.AbstractPropertyMapping.initIdentifierPropertyPaths(AbstractPropertyMapping.java:183)
at org.hibernate.persister.entity.AbstractPropertyMapping.initPropertyPaths(AbstractPropertyMapping.java:160)
at org.hibernate.persister.entity.AbstractEntityPersister.initOrdinaryPropertyPaths(AbstractEntityPersister.java:1458)
at org.hibernate.persister.entity.AbstractEntityPersister.initPropertyPaths(AbstractEntityPersister.java:1486)
at org.hibernate.persister.entity.AbstractEntityPersister.postConstruct(AbstractEntityPersister.java:2464)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:386)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1033)
If I removed the @JoinColumn annotation in PartyAffiliate class, the error goes away. I'm using 3.1Beta4.