2

We use hibernate 3 with some hbm.xml files. Recently, we found that a one-to-one association (based on primary keys) is not loaded lazily and thus, making some memory issues. After a little search, we found the solution for annotation-based hibernate configurations: Since the other side of the association is always present, it is only needed to add @OneToOne(optional=false) before the corresponding property in the java class.

The problem is that we have not used annotations! We tried to add the attribute optional="false" in the tag, which resulted in some xml parsing exceptions. We are looking for the equivalent of @OneToOne(optional=false) in hbm.xml files.

gate sumson
  • 163
  • 1
  • 11

1 Answers1

1

Based on the source, it looks like constrained=true is equivalent.

David Weinberg
  • 543
  • 3
  • 9