Posted by
Esteban A. Maringolo on
Nov 18, 2020; 4:01pm
URL: https://forum.world.st/Exclusive-collection-deletes-tp5124792.html
Hi,
I'm having an issue with elements added to a collection that is part
of an exclusive mapping that are always deleted.
I have a GwTournament that has a collection of aGwTournamentCategory,
but when I add a category to this collection, at the moment of
committing the unit of work the row is marked for deletion.
Getting into `UnitOfWork>>computeCollectionDeletesFor: aMapping
inObject: anObject` I notice that the memento and the object memento
are the same object, and so is the the value read using the mapping.
This causes all elements to be removed when the UOW is committed, I
don't know why this is so.
aDescriptor toManyMapping
attributeName: #categories;
referenceClass: GwTournamentCategory;
collectionType: SortedCollection;
orderBy: [ :each | (each getTable: 'GWTOURNAMENTCATEGORY') getField:
'position' ];
beExclusive;
join:
(Join
from: (table fieldNamed: 'id')
to: ((self tableNamed: 'GWTOURNAMENTCATEGORY') fieldNamed:
'tournament_id')).
If I remove the "beExclusive" then this doesn't happen anymore but it
causes the opposite situation: for some reason the elements are
removed from the collection, but never deleted from the DB, and new
elements are added each time.
Regards!
Esteban A. Maringolo
--
You received this message because you are subscribed to the Google Groups "glorp-group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[hidden email].
To view this discussion on the web visit
https://groups.google.com/d/msgid/glorp-group/CAJMgPCJ-9dPsqLa2yW4-iGzjk%3DNKQWkPPeBbHmKKJ%3DL_fXf1tA%40mail.gmail.com.