Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cascade Save

 
sridhar skrishnan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • 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,
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When mapping relationships, there is an attribute called cascade, I suggest using cascade="all" for now.

Mark
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic