« Return to Thread: Merge not savings cascade

Re: Merge not savings cascade

by enugala :: Rate this Message:

Reply to Author | View in Thread

Is any body is looking into this case?


enugala wrote:
Hi,

 Noted that merge is not saving with cascading effects.

 For example

 Class A {
  String a
  static  hasMany = [ bs : B ]

  static mapping = { bs lazy:false cascade : 'all'}
 }

 Now i got class B

 Class B {
  String b
 static belongsTo=A
 }

 Now lets say we add 2 elements of B to A

 like a1.addBs(b1) and a1.addBs(b2)
 and a1.save it saves a1, b1 and b2 and a1 is related to b1 and b2

 now we add a1.addBs(b3) and say a2=a1.merge() then a1 data and b3 is saved
 however a1 is not related to b3 and moreover even if i remove b1 or b2 it is not working.

 Is this a bug or something wrong with config?

 « Return to Thread: Merge not savings cascade