This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernte will delete rows from a table, but it won't insert rows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernte will delete rows from a table, but it won Watch "Hibernte will delete rows from a table, but it won New topic
Author

Hibernte will delete rows from a table, but it won't insert rows

Craig Dumolien
Greenhorn

Joined: Nov 07, 2005
Posts: 20
I'm using Hibernate as my dao. I have a child table (AUTHORITY) which Hibernate will delete from, but will not insert into. From my logs, it isn't even trying to insert into the table when I insert/update into my parent table (USERS). The tables are getting created the way I want and my classes are getting created the way I want. I perfer that my child class not have visibility to the parent, through the username column.

Other info: Happening with MySQL and DB2 databases; Weblogic Server 8.1.6, Tomcat 5.5 and Tomcat 6.0; Java compile version 1.4.2_11

I'm guessing I have something wrong in my mapping of the USERS table, since that is the parent. I've tried different combinations of the bags properties inverse and cascade, but nothing I've tried is working. I've even tried to use a set instead of a bag and that has not been successful.

Please let me know if there is any other information which would be helpful

Thanks for any help.


My parent table mapping (USERS):


My child table mapping (AUTHORITY):

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Hibernte will delete rows from a table, but it won't insert rows