Can one-to-one mappings be set to null? I have an optional one-to-one relationship that when I set to null, I get the exception below. According to the DTD, I can't see an option for "not-null" on one-to-one relationships. Is there something I'm missing or is it not allowed?
Thanks,
Rich
Hibernate version:
2.1.6
Mapping documents:
<one-to-one
name="floatTerms"
class="com.rcm.securitiesservice.domain.BondFloatTerms"
cascade="all"
constrained="true"
outer-join="auto"
access="field"
/>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Caused by: java.lang.Exception: not-null property references a null or transient value: com.rcm.securitiesservice.domain.CorpBond.floatTerms
at net.sf.hibernate.impl.SessionImpl.checkNullability(SessionImpl.java:1277)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:928)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:857)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:779)
at net.sf.hibernate.impl.SessionImpl.doCopy(SessionImpl.java:4013)
at net.sf.hibernate.impl.SessionImpl.saveOrUpdateCopy(SessionImpl.java:3980)
Name and version of the database you are using:
Oracle 9
Debug level Hibernate log excerpt:
|