DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
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)


Sort Order: Ascending order - Click to sort in descending order
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 added a comment - 18/Feb/11 06:48 PM
SVN trunk works for me.

Not backporting on 2.2 branch without commercial input