[jboss-jira] [JBoss JIRA] Closed: (EJBTHREE-725) Problem with OneToOne annotation

Carlo de Wolf (JIRA) jira-events at lists.jboss.org
Fri Jan 4 10:41:34 EST 2008


     [ http://jira.jboss.com/jira/browse/EJBTHREE-725?page=all ]

Carlo de Wolf closed EJBTHREE-725.
----------------------------------


> 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: AS 5.0.0.Beta3
>
>
> 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