[jboss-jira] [JBoss JIRA] Commented: (EJBTHREE-725) Problem with OneToOne annotation
Emmanuel Bernard (JIRA)
jira-events at lists.jboss.org
Thu Mar 22 19:43:02 EDT 2007
[ http://jira.jboss.com/jira/browse/EJBTHREE-725?page=comments#action_12357097 ]
Emmanuel Bernard commented on EJBTHREE-725:
-------------------------------------------
Actually close when HEM 3.3 is embedded, there is no 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 Pyatigorskiy
> Assigned To: Carlo de Wolf
> 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
More information about the jboss-jira
mailing list