Issue Details (XML | Word | Printable)

Key: NUCRDBMS-500
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: fitas amine
Votes: 0
Watchers: 0
Operations

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 ArticleContainerTestCase.zip (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: org.datanucleus.store.mapped.mapping.InterfaceMapping cannot be cast to org.datanucleus.store.mapped.mapping.PersistableMapping
at org.datanucleus.store.rdbms.sql.expression.ExpressionUtils.getEqualityExpressionForObjectExpressions(ExpressionUtils.java:397)
at org.datanucleus.store.rdbms.sql.expression.ObjectExpression.processComparisonOfImplementationWithReference(ObjectExpression.java:254)
at org.datanucleus.store.rdbms.sql.expression.ObjectExpression.eq(ObjectExpression.java:164)
at org.datanucleus.store.rdbms.query.QueryToSQLMapper.processEqExpression(QueryToSQLMapper.java:1470)
at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileRelationalExpression(AbstractExpressionEvaluator.java:77)
at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileOrAndExpression(AbstractExpressionEvaluator.java:65)
at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.evaluate(AbstractExpressionEvaluator.java:46)
at org.datanucleus.query.expression.Expression.evaluate(Expression.java:324)
at org.datanucleus.query.expression.DyadicExpression.evaluate(DyadicExpression.java:73)
at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compileFilter(QueryToSQLMapper.java:402)
at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compile(QueryToSQLMapper.java:322)
at org.datanucleus.store.rdbms.query.JDOQLQuery.compileQueryFull(JDOQLQuery.java:807)
at org.datanucleus.store.rdbms.query.JDOQLQuery.compileInternal(JDOQLQuery.java:293)
at org.datanucleus.store.query.Query.executeQuery(Query.java:1643)
at org.datanucleus.store.query.Query.executeWithMap(Query.java:1541)


fitas amine made changes - 17/Feb/11 12:45 PM
Field Original Value New Value
Attachment ArticleContainerTestCase.zip [ 11361 ]
Andy Jefferson made changes - 17/Feb/11 01:32 PM
Project DataNucleus JDO Query [ 10280 ] DataNucleus Store RDBMS [ 10144 ]
Key NUCJDOQUERY-5 NUCRDBMS-500
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 ]