• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

how to save collection object into database

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

We are having an object which has a collection (Set), i would like to save the set whenever i save that particular Class.

The Set has got many-to-many relation with another class.

The hbm file for that particular class and the database table is given below:-



the database table is as below:-

Mailbox table

mailbox_id
name
description
administrator_admin_id
notification_email

Account_Mailbox
account_id
mailbox_id

now when i save or update Mailbox object i have to save the accounts set along with it.

can anyone help me out in this regard

cheers
sai
 
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
fill the set with account_mailbox pojos and save the mailbox pojo. What happens? Aren't the account_mailbox details persisted in the link table. Do you see sany exceptions?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic