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?