org.hibernate.MappingException: Could not determine type




Asked on May 20, 2013
Hi Friends,

I am using @PrimaryKeyJoinColumn  and got below error.

 org.hibernate.MappingException: Could not determine type for: com.test.persistence.A, at table: Country, for columns: [org.hibernate.mapping.Column(a)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:291)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:275)
at org.hibernate.mapping.Property.isValid(Property.java:217)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:464)
at org.hibernate.mapping.RootClass.validate(RootClass.java:236)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1193)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1378)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)



Replied on May 20, 2013
Neel, @PrimaryKeyJoinColumn should not be used alone, @PrimaryKeyJoinColumn is used with @OneToOne

@OneToOne(cascade = CascadeType.ALL)
@PrimaryKeyJoinColumn



Write Answer











©2024 concretepage.com | Privacy Policy | Contact Us