The first option would reduce possible side effects by just
changing the EmbeddedValueToOneMapping, but I think the second
sounds like a generally "more correct" solution because you
never know if other mappings could benefit from acting on the
"correct" Builder.
However: I couldn't see an obvious way for doing either of these...
Joachim
Dear Joachim,today, I wrote a test that reproduced this problem (thanks for drawing it to my attention; as it happens, it relates to an area I was working in anyway). It seems to be specific to the interaction of embedded mappings with filtered mappings. More in a bit.
Yours faithfullyNiall Ross
-- ----------------------------------------------------------------------- Objektfabrik Joachim Tuchel mailto:jtu...@objektfabrik.de Fliederweg 1 http://www.objektfabrik.de D-71640 Ludwigsburg http://joachimtuchel.wordpress.com Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
mapObject: anObject inElementBuilder: anElementBuilder
| myTraceNode myBuilder |
"If the object already has a value in my slot, then this it got a cache hit, the embedded value was carried along for the ride, and we don't need to assign anything"
(self getValueFrom: anObject) isNil ifFalse: [^self]. "Otherwise, we need to look up the trace node that corresponds to this mapping, and get its instance"
myTraceNode := anElementBuilder expression get: self attributeName.
myBuilder := ((Query read: anElementBuilder instance class) session: self session) prepare elementBuilderFor: myTraceNode. .
self setValueIn: anObject to: myBuilder instance.
And in fact what I got was the correct mapping expression as #myBuilder: Base(Subclass).period
SimpleQuery>>#elementBuilderFor: anExpression
^builders detect: [:each | each expression == anExpression] ifNone: [nil].
Dear Joachim,today, I wrote a test that reproduced this problem (thanks for drawing it to my attention; as it happens, it relates to an area I was working in anyway). It seems to be specific to the interaction of embedded mappings with filtered mappings. More in a bit.
Yours faithfullyNiall Ross
On 10 Mar 2017, at 11:26, jtuchel <jtu...@objektfabrik.de> wrote:
SimpleQuery>>#elementBuilderFor: anExpression with a test for #=
-- You received this message because you are subscribed to a topic in the Google Groups "glorp-group" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/glorp-group/9OoVg5QRPPg/unsubscribe. To unsubscribe from this group and all its topics, send an email to glorp-group...@googlegroups.com. To post to this group, send email to glorp...@googlegroups.com. Visit this group at https://groups.google.com/group/glorp-group. For more options, visit https://groups.google.com/d/optout.