• 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
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

hibernate one-to-many mapping, inserting associated objects in collection along with parent

 
Abhishek Reddy
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi everyone,

I created a one-to-many mapping between two table for example employee and emptechnologies, its like an employee knows many technologies

here are the respective mapping files
employee table



emptechnologies table



Here is the access Code..........



When i try to run this code it is giving the following error......

error
 
Abhishek Reddy
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have modified the mapping file for emptechnologies



Now, there are no errors, but failed to save the collection of childs in the database.

what is the workaround? did i miss anything?
do i need to iterate through each and every child in collection and save them separately?

 
Abhishek Reddy
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its working, i have to add cascade="all" in the employee mapping file



Actually i tried for uni-directional mapping, but it forced to have bi-directional mapping.

I would like to know the reason to opt for bi-directional mapping.
 
I didn't like the taste of tongue and it didn't like the taste of me. I will now try this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic