Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelpHibernate version:2.1.7 Mapping documents:
/ * @hibernate.set
* cascade="all" inverse="true"
* @hibernate.collection-one-to-many
* class="java.package.OpQuestionAnswer"
* @hibernate.collection-key
* column="OPPORTUNITY_ID"
*/
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 9.1 The generated SQL (show_sql=true):Debug level Hibernate log excerpt:I have two tables. They are in association where table A is 1:N relationship with table B. My pojo of table A has a set to hold a collection of records for Table B. The mapping is provided above.
The problem is when insert an new record in Table A, it tries to do an update on table B as opposed to doing an insert. Since both these records are new.
Similarly, for the same case if there is a recordin table A and i try to make new entry for it in table B. I add an instance of a record into the Set in the pojo of Table A. When I run an update on table A it runs an update on table B as opposed to running an insert.
Any suggestion on what I might be missing ? Another note Table B has a composite key in it. Which has ben implemented using a object which has the composite key member in it.