On Sun, Feb 7, 2010 at 11:23 AM, Andrus Adamchik wrote:

On Feb 7, 2010, at 5:39 PM, Andrey Razumovsky wrote:

Also we need to check Victor's comment:
I did and I agree with him about the semantics of the fix.

I'm reaching here a bit since it's been a while since I looked at this
problem, but I think the semantics were preserved because isSubentityOf
wasn't a proper subentity relationship. I.e., an entity could be a
subentity of itself. So, while the code looks strange, it worked.

Also, answering my own earlier observation:

DirectToSubEntity.subEntities is NOT a reverse relationship of
Looks like a simple model of relationship/reverse relationship breaks when
inheritance is involved. If we define "reverse" as relationship over the
same set of joins, just going in the opposite direction, then we can have
multiple reverse relationships for any single relationship and will need to
do much more e.g. when connecting related objects...
I'll have to take a look at this test case again. I believe my patch fixed
a very specific instance of what I thought at the time was a much larger

The core issue I was seeing at the time was something along the lines of:

Customer is a subclass of Account
Customer requires an Address

There is no explicit mapping from Account to Address.
There is a mapping between Customer and Address and is marked as mandatory.

Cayenne added a runtime relationship from Account to Address and used that
when doing something like customer.setAddress(), bypassing the mapped
relationship, which caused a validation failure.

IIRC, the patch I supplied allowed the relationship search to compare
against a broader range of src-target pairings, allowing it to find the
relationship I explicitly mapped.

I may have some of the details wrong there since I haven't dealt with this
is a while. But I should be able to pull up the mapping that wasn't working
for me.


Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 8 of 24 | next ›
Discussion Overview
groupdev @
postedFeb 7, '10 at 3:18p
activeFeb 27, '10 at 7:38p



site design / logo © 2021 Grokbase