On 3/28/08 9:43 AM, "Andrus Adamchik" <andru..bjectstyle.org> wrote:
> It changed 'getReverseRelationship' which is a generic method not
> specifically related to runtime relationships logic (and I must admit
> I still don't fully understand the logic in the fix..) Anyways, what
> I'm saying is that the caller of this method should be responsible for
> making a decision whether a runtime relationship makes sense or not,
> not the method itself.
The execution may have been off (removing the condition altogether seems to
accomplish the same thing), but the general idea is to not do direct type
checking. The old check was the following:
if (rel.getTargetEntity() != src)
continue;
But, elsewhere entity matching is done based on a deep attribute matching.
BaseEntity and SubEntity essentially have the same structure and the latter
may be used in place of the former. The aforementioned check, however,
would explicitly disallow this.
The result is that the method would return null, causing EntityResolver to
determine that a runtime relationship should be created.
What I intended is that if an exact match could not be made, don't bail out
yet, because a subclass might be able to fulfill the obligation. In that
case, a non-null value would be returned and EntityResolver would at that
point decide not to create a runtime relationship.
If I understand correctly, you'de rather see the null returned and let
EntityResolver investigate more itself at that point?
-- Kevin
This archive was generated by hypermail 2.0.0 : Fri Mar 28 2008 - 10:03:43 EDT