• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Inner classes mapped with composite-id not saving into database in Hibernate mapping

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I am trying to persist a jaxb object using hibernate into db. All the details in Notice & Document will go in one main table and Slip details will go into other table Below is the jaxb class.


My hbm mapping files:

Ticket.hbm.xml



Document.hbm.xml


When i call session.save(ticket) It is saving only the the primaryKeyNumber in Document table not saving other details in Notice & Slip details

Below is the query generated in log

SQL] - insert into Document_Table (primaryKeyNumber) values (?) Hibernate: insert into Document_Table (primaryKeyNumber) values (?)

Ideally the query should insert all values from Ticket,Document & Notice values and also should generate separate queries to insert Slip Details into Slip_Table like below

Hibernate: insert into Document_Table (primaryKeyNumber,event,eventType,transactionCode,transactionType ) values (?,?,?,?,?)

if I call session.save(ticket.getDocument()) , then document details are recorded in the table without any Notice & slip details

Please help me to find where I have gone wrong here.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic