I am sorry - but I did not understand your message.
What is the meaning
Quote:
do you by any chance set the parent of the child explicitly
The xml of the insertionString:
Code:
<class name="com.oversi.generated.generatedFiles.InsertionsString" table="insertions_string" schema="public">
<composite-id name="id" class="com.oversi.generated.generatedFiles.InsertionsStringId">
<key-property name="eventId" type="long">
<column name="event_id" />
</key-property>
<key-property name="index" type="short">
<column name="index" />
</key-property>
</composite-id>
<many-to-one name="events" class="com.oversi.generated.generatedFiles.Events" update="false" insert="false" fetch="select">
<column name="event_id" not-null="true" />
</many-to-one>
<property name="insertionStr" type="string">
<column name="insertion_str" not-null="true" />
</property>
</class>
The code to save the object:
Code:
event.setServerName("arak");
InsertionsString newInsertionStr = new InsertionsString();
newInsertionStr.setId(newInsertionsStringId((long)event.getId(),1));
newInsertionStr.setInsertionStr("kkkk");
newInsertionString.setEvents(event);
Set <InsertionString> insertionStrSet = new HashSet();
insertionStrSet.add(newInsertionStr);
event.setInsertionString(insertionStrSet);
session.saveOrUpdate(event);
session.commit();
Is something wrong with this code?