-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Property name case when using @OneToOne(mappedBy)
PostPosted: Thu Oct 22, 2009 5:59 am 
Newbie

Joined: Mon Feb 20, 2006 9:23 am
Posts: 9
I have two persistable Java classes set up in a 1-1 bidirectional relationship as follows:

Code:
@Entity
public class Foo implements Serializable {
    @OneToOne(cascade={CascadeType.REMOVE,CascadeType.MERGE})
    @JoinColumn(name="Bar_FK")
    @LazyToOne(value=LazyToOneOption.FALSE)
    public XYZBar getXYZBar() { ... }
}

@Entity
public class XYZBar implements Serializable {
    @OneToOne(mappedBy="XYZBar")
    @LazyToOne(value=LazyToOneOption.FALSE)
    public Foo getFoo() { ... }
}


The problem is when running hbm2ddl on these classes I get an

Code:
org.hibernate.AnnotationException: Unknown mappedBy in: XYZBar.Foo
referenced property unknown: Foo.XYZBar


I suspect the problem is to do with case-sensitivity, but I've tried

mappedBy="xYZBar"
mappedBy="xyzBar"
mappedBy="xyzbar"

all without success. What does Hibernate expect by way of case conversion rules
when dealing with properties that start with more than one capital letter?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.