Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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):

 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!