cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Dombrosky" <dom...@gmail.com>
Subject Re: Using "relationship != null" qualifier with ObjEntity Inheritance
Date Wed, 06 Aug 2008 18:54:43 GMT
Oh boy.  What do you recommend in the meantime?

Do I have to add another column just to hold the type like the
documentation example shows?  Not the best solution in this case, but
I guess it can be done if need be.

-Dave


On Wed, Aug 6, 2008 at 2:47 PM, Andrus Adamchik <andrus@objectstyle.org> wrote:
> Ok, I see. This indeed is a limitation of the inheritance algorithm. We
> can't evaluate the inheritance qualifier expression in-memory in this case.
> We can probably improve on that in the future, but there is no easy fix.
>
> Andrus
>
>
> On Aug 6, 2008, at 2:29 PM, Dave Dombrosky wrote:
>
>> Yes it is just a 1:1 mapping on the relationship.
>>
>> Here is the stack trace:
>>
>> org.apache.cayenne.exp.ExpressionException: [v.3.0-SNAPSHOT Aug 01
>> 2008 19:55:10] Error evaluating expression 'db:some_relationship !=
>> null'
>>        at
>> org.apache.cayenne.exp.parser.SimpleNode.evaluate(SimpleNode.java:331)
>>        at org.apache.cayenne.exp.Expression.match(Expression.java:367)
>>        at
>> org.apache.cayenne.map.EntityInheritanceTree.entityMatchingRow(EntityInheritanceTree.java:97)
>>        at
>> org.apache.cayenne.map.EntityInheritanceTree.entityMatchingRow(EntityInheritanceTree.java:83)
>>        at
>> org.apache.cayenne.access.ObjectResolver.objectFromDataRow(ObjectResolver.java:194)
>>        at
>> org.apache.cayenne.access.ObjectResolver.objectsFromDataRows(ObjectResolver.java:121)
>>        at
>> org.apache.cayenne.access.ObjectResolver.synchronizedObjectsFromDataRows(ObjectResolver.java:101)
>>        at
>> org.apache.cayenne.access.DataDomainQueryAction$ObjectConversionStrategy.toObjects(DataDomainQueryAction.java:591)
>>        at
>> org.apache.cayenne.access.DataDomainQueryAction$SingleObjectConversionStrategy.convert(DataDomainQueryAction.java:661)
>>        at
>> org.apache.cayenne.access.DataDomainQueryAction.interceptObjectConversion(DataDomainQueryAction.java:466)
>>        at
>> org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:128)
>>        at
>> org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:740)
>>        at
>> org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:317)
>>        at
>> org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96)
>>        at
>> org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1336)
>>        at
>> org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1325)
>>        at
>> org.apache.cayenne.access.ToOneFault.doResolveFault(ToOneFault.java:82)
>>        at
>> org.apache.cayenne.access.ToOneFault.resolveFault(ToOneFault.java:55)
>>        at
>> org.apache.cayenne.CayenneDataObject.readProperty(CayenneDataObject.java:208)
>>        at
>> org.apache.cayenne.CayenneDataObject.setToOneTarget(CayenneDataObject.java:295)
>>
>> -Dave
>>
>>
>> On Wed, Aug 6, 2008 at 11:59 AM, Andrus Adamchik <andrus@objectstyle.org>
>> wrote:
>>>
>>> Could you post a bigger part of the stack trace (at least everything that
>>> has org.apache.cayenne in it)?
>>>
>>> From what I can see, this is related to in-memory evaluation of the
>>> qualifier. If that's a to-one relationship based on FK, intuitively this
>>> should work, but it probably hits a limitation on in-memory evaluation.
>>>
>>> Andrus
>>>
>>>
>>> On Aug 5, 2008, at 5:23 PM, Dave Dombrosky wrote:
>>>
>>>> I am currently trying to use ObjEntity Inheritance in my project, but
>>>> I am running into some difficulties.  I was hoping that I could use
>>>> "someRelationship != null" as the qualifier, but I get the following
>>>> error when trying to run the code:
>>>>
>>>> org.apache.cayenne.exp.ExpressionException: [v.3.0-SNAPSHOT Aug 01
>>>> 2008 19:55:10] Error evaluating expression 'db:some_relationship !=
>>>> null'
>>>>
>>>> Am I doing something wrong here, or did I find a bug?
>>>>
>>>> -Dave
>>>>
>>>
>>>
>>
>
>

Mime
View raw message