I have two annotated classes:
@Entity
@IdClass( SkulPopulationRelationshipEndNodePk.class )
@Table( name = "skul_pop_rel_end" )
public class SkulPopulationRelationshipEndNode extends SkulPopulationRelationshipEndNodeBase
{
@Id
private Integer skulNumber;
@Id
private Integer edgeSkulNumber;
@Column( name="edge_type", precision=1 )
private Byte edgeType;
@OneToOne
@LazyToOne( LazyToOneOption.NO_PROXY )
@JoinColumn( name="edge_skul_no",
referencedColumnName="skul_no",
insertable=false,
updatable=false )
@NotFound( action=NotFoundAction.IGNORE )
private OptimizedResultsMeo edgeOptimizedResultsMeo;
}
public class OptimizedResultsMeo implements Serializable
{
@Id
@Column( name="skul_no", length=7 )
private Integer skulNumber;
@Column( name="item_no", length=65 )
protected String itemNumber;
}
Here is the PK class for SkulPopulationRelationshipEndNode:
@Embeddable
public class SkulPopulationRelationshipEndNodePk extends SkulPopulationRelationshipEndNodeBase
{
@Column( name="skul_no", precision=8, scale=0 )
private Integer skulNumber;
@Column( name="edge_skul_no", precision=8, scale=0 )
private Integer edgeSkulNumber;
}
I want to create OneToOne link:
SkulPopulationRelationshipEndNodeBase.edgeSkulNUmber -> OptimizedResultsMeo.skulNumber
I get the following exception when i try to load these 2 classes:
org.hibernate.MappingException: broken column mapping for: edgeOptimizedResultsMeo.id of: net.gainsystems.common.clientserverbatch.hibernate.skul.grouping.SkulPopulationRelationshipEndNode
at org.hibernate.persister.entity.AbstractPropertyMapping.initPropertyPaths(AbstractPropertyMapping.java:121)
at org.hibernate.persister.entity.AbstractPropertyMapping.initIdentifierPropertyPaths(AbstractPropertyMapping.java:177)
at org.hibernate.persister.entity.AbstractPropertyMapping.initPropertyPaths(AbstractPropertyMapping.java:159)
at org.hibernate.persister.entity.AbstractEntityPersister.initOrdinaryPropertyPaths(AbstractEntityPersister.java:1708)
at org.hibernate.persister.entity.AbstractEntityPersister.initPropertyPaths(AbstractEntityPersister.java:1738)
at org.hibernate.persister.entity.AbstractEntityPersister.postConstruct(AbstractEntityPersister.java:2914)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:409)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
at net.gainsystems.common.serverbatch.hibernate.HibernateSessionFactory.<init>(HibernateSessionFactory.java:226)
Can anyone point out what changes I have to make to fix this relationship?
_________________ LET IT BE :)
|