DELETE on JOIN Table happens after I change (append) value to a list

21 views
Skip to first unread message

zenoki...@gmail.com

unread,
Mar 31, 2015, 12:41:23 AM3/31/15
to activate-p...@googlegroups.com
Hi Guys,

I have a entity defined like this: 

  case class Instance(

    @Alias("_id") var seId: String,

   @Alias("_keyset") var InstanceKeyset: List[InstanceKeyset]

  )  extends Entity


And I initialised it using this: 


new Instance(seId, List(ks1, ks2))

what I see on the logs on mysql is like this:

INSERT INTO `se_instance` (`_id`, `_keyset`)  VALUES ('96050d3e-d74b-11e4-aebc-3fcfb10387e4-b61bccbc', '1');

INSERT INTO instance_keysets(....)

INSERT INTO instance_keysets(...)

delete from _keyset where owner = ....

insert into _keyset(....

insert into _keyset(....


as you can see, it deletes first all the _keyset row with the given owner and insert two row to establish the linked between Instance and InstanceKeyset.


Is this the proper behaviour?


Thanks,


- Leo B


zenoki...@gmail.com

unread,
Mar 31, 2015, 1:01:46 AM3/31/15
to activate-p...@googlegroups.com, zenoki...@gmail.com
In addition, even on adding new elements to the list, it did a delete then inserts all elements.
Reply all
Reply to author
Forward
0 new messages