[
http://jira.jboss.com/jira/browse/EJBTHREE-725?page=all ]
Emmanuel Bernard updated EJBTHREE-725:
--------------------------------------
Fix Version/s: EJB 3.0 RC11 - FD
Priority: Major (was: Minor)
you're right,
http://opensource.atlassian.com/projects/hibernate/browse/ANN-556
Unfortunately the fix will be post RC10 ie any version using HAN 3.2.2
Problem with OneToOne annotation
--------------------------------
Key: EJBTHREE-725
URL:
http://jira.jboss.com/jira/browse/EJBTHREE-725
Project: EJB 3.0
Issue Type: Bug
Affects Versions: EJB 3.0 RC9 - FD
Reporter: Ilya
Fix For: EJB 3.0 RC11 - FD
Given 2 classes as in hibernate doc:
@Entity
public class Body {
@Id
public Long getId() { return id; }
@OneToOne
@PrimaryKeyJoinColumn
public Heart getHeart() {
return heart;
}
...
}
@Entity
public class Heart {
@Id
public Long getId() { ...}
@OneToOne(mappedBy = "heart")
public Body getBody() {
return body;
}
}
everything works, but when I moved mappedBy to body deployment failed with NPE in class
OneToOneSecondPass on line 135, because otherSideProperty was null.
Testcase (deploymnt fails with NPE):
------------------
@Entity
public class Body {
@Id
public Long getId() { return id; }
@OneToOne(mappedBy = "body")
public Heart getHeart() {
return heart;
}
...
}
@Entity
public class Heart {
@Id
public Long getId() { ...}
@OneToOne
@PrimaryKeyJoinColumn
public Body getBody() {
return body;
}
}
------------------
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira