• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to save collection object into database

 
Saikiran Madhavan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • 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
 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic