Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.0
Mapping documents:
<class name="com.abc.performance.UserAppraisalData" table="USER_APPRAISAL_RESPONSES" lazy="false">
<id column="ID" name="id" type="long" unsaved-value="null">
<generator class="hilo"/>
</id>
<discriminator column="RESPONSE_TYPE" type="string"/>
<timestamp column="LAST_MODIFIED_TS" name="lastModifiedTS"/>
<many-to-one name="user" class="com.abc.security.User" column="USER_ID" not-null="true" outer-join="true" lazy="true"/>
<many-to-one name="appraisal" class="com.abc.performance.PerformanceAppraisal" column="APPRAISAL_ID" not-null="true" lazy="false"/>
<many-to-one name="status" class="com.abc.performance.WorkflowStep" column="STATUS_ID" not-null="true" lazy="false"/>
<property column="SECTION_ID" length="10" name="pageSectionId" type="long"/>
<subclass name="com.abc.performance.UserAppraisalCart" discriminator-value="UserAppraisalCart" lazy="false">
<property column="RESPONSE_WEIGHT" length="10" name="inCart" type="long"/>
<many-to-one name="section" class="com.abc.performance.ReviewTemplatePageSection" column="RESPONSE_ID" outer-join="false" not-null="true" lazy="true"/>
<property column="RESPONSE_ID" length="10" name="sectionId" type="long" insert="false" update="false"/>
<property column="GOAL_COMP_ID" length="10" name="goalCompId" type="long"/>
</subclass>
<subclass name="com.abc.performance.UserAppraisalSignature" discriminator-value="UserAppraisalSignature" lazy="false">
<property column="RESPONSE_VALUE" length="50" name="signature" type="string"/>
</subclass>
<subclass name="com.abc.performance.UserAppraisalRating" discriminator-value="UserAppraisalRating" lazy="false">
<many-to-one name="formula" class="com.abc.performance.Formula" column="RESPONSE_ID" not-null="true" outer-join="false" lazy="false"/>
<property column="RESPONSE_WEIGHT" length="10" not-null="true" name="ratingValue" type="double"/>
<property column="RESPONSE_ID" length="10" name="formulaId" type="long" insert="false" update="false"/>
</subclass>
<subclass name="com.abc.performance.ManagerSelectedCompetency" discriminator-value="ManagerSelectedCompetency" lazy="false">
<many-to-one name="section" class="com.abc.performance.ReviewTemplatePageSection" column="RESPONSE_ID" outer-join="false" not-null="true" lazy="true"/>
<set name="managerCompetencies" table="KCT_SECTION_MANAGER_COMPETENCY" lazy="false">
<key column="SECTION_ID"/>
<many-to-many class="com.abc.common.Competency" column="COMPETENCY_ID"/>
</set>
</subclass>
<subclass name="com.abc.performance.UserResponse" discriminator-value="UserResponse" lazy="false">
<property column="GOAL_COMP_ID" length="10" name="goalCompId" type="long"/>
<property column="IS_ADHOC_RESPONSE" length="1" name="isAdhocResponse" not-null="true" type="true_false"/>
<many-to-one name="response" class="com.abc.performance.SectionResponse" column="RESPONSE_ID" not-null="true" outer-join="false" lazy="false"/>
<property column="RESPONSE_ID" length="10" name="responseId" type="long" insert="false" update="false"/>
<subclass name="com.abc.performance.UserAppraisalResponse" discriminator-value="UserAppraisalResponse" lazy="false">
<property column="RESPONSE_VALUE" length="500" name="responseValue" type="string"/>
<set name="ratingValues" inverse="true" outer-join="true" cascade="all-delete-orphan" lazy="true">
<key column="USER_APPRAISAL_RESPONSE_ID"/>
<one-to-many class="com.abc.performance.UserResponseRatingValue"/>
</set>
</subclass>
<subclass name="com.abc.performance.UserAppraisalResponseWeight" discriminator-value="UserAppraisalResponseWeight" lazy="false">
<property column="RESPONSE_WEIGHT" length="10" not-null="true" name="responseWeight" type="long"/>
</subclass>
</subclass>
</class>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
ORACLE 9i
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
I am randomly getting
cannot insert NULL into ("TEST"."USER_APPRAISAL_RESPONSES"."ID")