Thanx gavin,
I did change the mappings but still not working for me. The insert query is giving me an exception. Can I see the values somehow that it is trying to insert ?
Parent :
<set name="aphasiaTypes" inverse="true" cascade="all-delete-orphan" >
<key column="SUBJECT_ID"/>
<one-to-many class="com.imc.sts.domain.the.SubjectAphasia" />
</set>
Child :
<many-to-one name="parentSubject" class="com.imc.sts.domain.the.Subject" column="SUBJECT_ID" not-null="true" />
Exception :
Hibernate: insert into STS.METADATA_SUBJECT_APHASIA (TIMESTAMP, SUBJECT_ID, APHASIA_ID, ID) values (?, ?, ?, ?)
WARN [http8080-Processor2] JDBCExceptionReporter.logExceptions(38) | SQL Error: 1, SQLState: 23000
ERROR [http8080-Processor2] JDBCExceptionReporter.logExceptions(46) | ORA-00001: unique constraint (STS.SYS_C002207) violated
WARN [http8080-Processor2] JDBCExceptionReporter.logExceptions(38) | SQL Error: 1, SQLState: 23000
ERROR [http8080-Processor2] JDBCExceptionReporter.logExceptions(46) | ORA-00001: unique constraint (STS.SYS_C002207) violated
ERROR [http8080-Processor2] JDBCException.<init>(38) | Could not execute JDBC batch update
java.sql.SQLException: ORA-00001: unique constraint (STS.SYS_C002207) violated
Constraints :
- AphasiaId not null
- SubjectId not null
- Unique constraint on combination of AphasiaId and SubjectId
- Referential Integrity for AphasiaId and SubjectId,
- ID Primary key
nitin
|