I have an entity, TrackLog
that has a component collection of TrackPoints
. I create a new TrackLog
and add some Trackpoints
to it and save it to the DB.
When I grab my TrackLog
again and add a new TrackPoint
, instead of doing one SQL INSERT like I expect, it's doing a DELETE on all the TrackPoints
associated with the TrackLog
and then re-adding every TrackPoint
that's in the collection.
This is the output from NHProf:
UPDATE TrackLog SET Version = 2 etc...
DELETE FROM TrackPoints WHERE TrackLog_Id = '80cc1e0d' etc...
INSERT INTO TrackPoints etc..
INSERT INTO TrackPoints etc...
INSERT INTO TrackPoints etc...
My question is, is this normal behavior for a component collection? This happens as well for my enum collections. If this is not normal behavior, how do I modify my mappings so that it exhibits the correct behavior (only one INSERT for the TrackPoint
I added)?