• 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

Cascade Save

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

Am back again with another problem. Say, I have 2 tables A and B with a one-to-many association from A to B. I want to add insert a record into B which involves inserting a Dummy record into A. Can anyone tell me how to go about it? Would I be able to do a cascade save?

i tried adding object B to Object A as a HashSet and then saving A. But it didnt work. The record was inserted in A but the corresponding record was not saved in B.

Some Pointers will be really helpful. Will put across my code and mapping files if needed.

Thanks,
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When mapping relationships, there is an attribute called cascade, I suggest using cascade="all" for now.

Mark
reply
    Bookmark Topic Watch Topic
  • New Topic