Hibernate version:
3.2
Mapping documents:
Code:
<class name="main.org.jboss.portlet.milestone.spring.dto.EntryValues"
table="entryValues" >
<id column="id" name="id">
<generator class="increment" />
</id>
<property name="value" column="value" type="string" not-null="false" />
<property name="value_bool" column="value_bool" type="boolean" not-null="false" />
<property name="value_date" column="value_date" type="date" not-null="false" />
<!--<property name="value_file" column="value_file" type="main.org.jboss.portlet.milestone.spring.dto.UFile" not-null="false" />-->
<one-to-one name="value_file" class="main.org.jboss.portlet.milestone.spring.dto.UFile" cascade="save-update"/>
<property name="selected" column="selected" type="main.org.jboss.portlet.milestone.spring.dto.Pair" not-null="false" />
<property name="dataType" column="dataType" not-null="false"
type="main.org.jboss.portlet.milestone.spring.dto.DataType" />
<list name="values">
<key column="pair_id" />
<list-index column="pair_idx" />
<one-to-many class="main.org.jboss.portlet.milestone.spring.dto.Pair"/>
</list>
</class>
<class name="main.org.jboss.portlet.milestone.spring.dto.UFile" table="ufile" lazy="true">
<id column="id" name="id">
<generator class="foreign">
<param name="property">entryValues</param>
</generator>
</id>
<property name="fileName" column="filename" type="string" />
<property name="contentType" column="contenttype" type="string" />
<property name="content" column="content" type="blob" />
<one-to-one name="entryValues" class="main.org.jboss.portlet.milestone.spring.dto.EntryValues" constrained="true"/>
</class>
Code :Code:
getHibernateTemplate().save(entry);
Exception:Code:
2007-05-14 09:34:05,718 FATAL [main.org.jboss.portlet.milestone.spring.persistence.EntryManager] - attempted to assign id from null one-to-one property: entryValues; nested exception is org.hibernate.id.IdentifierGenerationException: attempted to assign id from null one-to-one property: entryValues
Hi all,
I have a little problem with the <one-to-one> Tag ... please help,
thanks in advance,
Omid
[/code]