Hi All,
I get an NPE, when I try to map the ID in a general super class and use the OneToOne mapping (with XDoclet this has been working fine).
Hibernate version:
3.0rc
annotations 3.0 alpha 3
Example:
Code:
@Entity
public class DomainObject extends AbstractDomainObject {
private Address address;
@OneToOne(cascade = { CascadeType.CREATE })
@JoinColumn(name = "ADDRESS_ID")
public Address getAddress() {
return address;
}
public void setAddress( Address address ) {
this.address = address;
}
}
The general super class:
Code:
public abstract class AbstractDomainObject {
private long id;
@Id(generate = GeneratorType.AUTO)
public long getId() {
return id;
}
public void setId( long id ) {
this.id = id;
}
}
Stack trace:Code:
java.lang.NullPointerException
at org.hibernate.cfg.AnnotationBinder.bindOneToOne(AnnotationBinder.java:1139)
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:734)
at org.hibernate.cfg.AnnotationBinder.processElementsOfAClass(AnnotationBinder.java:532)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:382)
at org.hibernate.cfg.AnnotationConfiguration.addAnnotatedClass(AnnotationConfiguration.java:44)
Database dialect:
org.hibernate.dialect.MySQLInnoDBDialect
Thanks for any help!
Swen