Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: fitas amine
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

JDOQL of "interfaceField == implValue" causes exception

Created: 17/Feb/11 12:45 PM   Updated: 07/Mar/11 05:37 PM   Resolved: 18/Feb/11 06:48 PM
Component/s: Queries
Affects Version/s: 2.2.0.m1, 2.2.1, 3.0.0.m1
Fix Version/s: 3.0.0.m2

File Attachments: 1. Zip Archive (6 kB)

Environment: all versions of DN

Severity: Production

 Description  « Hide
imagine Class A and B, Class A implements and Interface let s call it C.

class B is a Child of A.

now class D has a persistant member which is of the interface type C.

now logically if I want to query class D I can use both types class A and B

but when I uses class B the below exception happens

I have attached a special test case which demonestrate this problem.

java.lang.ClassCastException: cannot be cast to
at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileRelationalExpression(
at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileOrAndExpression(
at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.evaluate(
at org.datanucleus.query.expression.Expression.evaluate(
at org.datanucleus.query.expression.DyadicExpression.evaluate(

fitas amine made changes - 17/Feb/11 12:45 PM
Field Original Value New Value
Attachment [ 11361 ]
Andy Jefferson made changes - 17/Feb/11 01:32 PM
Project DataNucleus JDO Query [ 10280 ] DataNucleus Store RDBMS [ 10144 ]
Affects Version/s 3.0.0.m1 [ 11062 ]
Affects Version/s 2.2.1 [ 11090 ]
Affects Version/s 2.2.0.m1 [ 11000 ]
Affects Version/s 2.2.0.m1 [ 11058 ]
Affects Version/s 2.2.1 [ 11145 ]
Affects Version/s 3.0.0.m1 [ 11146 ]
Andy Jefferson added a comment - 17/Feb/11 01:32 PM
Nothing to do with JDO Typesafe queries, so no idea why it was raised there. Moved to RDBMS

Andy Jefferson made changes - 18/Feb/11 06:47 PM
Summary derived classes which has a super class implemeting and interface can not be used as a type in a Query using them as a Type JDOQL of "interfaceField == implValue" causes exception
Component/s Queries [ 10142 ]
Andy Jefferson added a comment - 18/Feb/11 06:48 PM
SVN trunk works for me.

Not backporting on 2.2 branch without commercial input

Andy Jefferson made changes - 18/Feb/11 06:48 PM
Status Open [ 1 ] Resolved [ 5 ]
Assignee Andy Jefferson [ andy ]
Fix Version/s 3.0.0.m2 [ 11151 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 07/Mar/11 05:37 PM
Status Resolved [ 5 ] Closed [ 6 ]