Hi, all
I get this error and can't undestand why.
Does it mena that property "organization" is null or transient ?
Code:
net.sf.hibernate.PropertyValueException: not-null property references a null or transient value: net.sf.hibernate.persister.EntityPersister.organization
Mapping code:
Code:
<hibernate-mapping>
<class
name="com.clearview.feedback.db.report.Report"
table="report"
dynamic-update="true"
dynamic-insert="false"
mutable="true"
> .....
<many-to-one
name="organization"
class="com.clearview.feedback.db.Organization"
cascade="save-update"
outer-join="auto"
update="true"
insert="true"
column="org_id"
unique="false"
/>
And there's my code:
Code:
session.refresh(visit.getOrganization());
Report report = new Report(owner, description, status,
report.setMessage(visit.getMessage());
report.setReferenceId(WebUtils.getInstance().generateLogin());
session.beginTransaction();
session.save(report);
session.commit();
And when i try to commit transaction i get such exception. In debug i see that "organization" property in report is not null. Does anyone know what's wrong with my code? I use 2.1 hibernate.
Thank's