I tried to remedy the situation by extending a TreeSet and overriding the equals method. If the object used my hibernate is a Set of the same size I called them equal. I am still getting the delete/inserts. Here is a peak at my config files, tell me if you see anything odd.
The xref table below is the one that gets deleted and re-created.
Code:
<hibernate-mapping package="com.campuspartners.webexit.dao">
<class name="Exam" table="exam">
<id name="examid" column="examid" type="java.lang.Integer">
<generator class="identity"/>
</id>
<property name="testType" column="testtype" type="java.lang.String" />
<property name="name" column="name" type="java.lang.String" />
<set name="TestQuestions" lazy="false" table="examquestionxref">
<key column="examid"/>
<many-to-many
class="com.campuspartners.webexit.dao.TestQuestion"
column="questionid"/>
</set>
</class>
</hibernate-mapping>
<hibernate-mapping package="com.campuspartners.webexit.dao">
<class name="TestQuestion" table="testquestion">
<id name="questionid" column="QuestionID" type="java.lang.Integer">
<generator class="identity"/>
</id>
<property name="testtype" column="TestType" type="java.lang.String"/>
<property name="questiontype" column="QuestionType" type="java.lang.String" />
<property name="contexttext" column="ContextText" type="java.lang.String" />
<property name="questiontext" column="QuestionText" type="java.lang.String" />
<property name="questionsequence" column="QuestionSeq" type="java.lang.Short" />
<set name="QuestionChoices" lazy="false" table="questionchoicexref" >
<key column="questionid"/>
<many-to-many
class="com.campuspartners.webexit.dao.QuestionChoice"
column="choiceid"/>
</set>
</class>
</hibernate-mapping>
<hibernate-mapping package="com.campuspartners.webexit.dao">
<class name="ExamQuestionXref" table="examquestionxref">
<composite-id name="id" class="ExamQuestionXrefKey">
<key-property name="examid" column="ExamID" type="java.lang.Integer"/>
<key-property name="questionid" column="QuestionID" type="java.lang.Integer"/>
</composite-id>
</class>
</hibernate-mapping>