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-279
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

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

JDOQL2 : new object doesn't cope with arguments that have more than 1 column mapping

Created: 22/Oct/09 02:52 PM   Updated: 23/Oct/09 04:08 PM   Resolved: 22/Oct/09 03:55 PM
Component/s: Queries
Affects Version/s: None
Fix Version/s: 2.0.0.m3


 Description  « Hide
If we have
SELECT new org.jpox.samples.models.company.PersonHolder(this) FROM ...
and the candidate class has a PK with more than 1 PK field then this breaks since, while it selects the columns in the generated SQL it doesn't keep a note that there is more than 1 column!! so just thinks it needs the first and we get

Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
        at org.datanucleus.store.mapped.mapping.PersistableMapping.getObjectForApplicationIdentity(PersistableMapping.java:1028)
        at org.datanucleus.store.mapped.mapping.PersistableMapping.getObject(PersistableMapping.java:776)
        at org.datanucleus.store.rdbms.query.ResultClassROF.getValueForNewObject(ResultClassROF.java:502)
        at org.datanucleus.store.rdbms.query.ResultClassROF.getObject(ResultClassROF.java:341)
        at org.datanucleus.store.rdbms.query.ScrollableQueryResult.getObjectForIndex(ScrollableQueryResult.java:191)

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 22/Oct/09 03:55 PM
SVN trunk fixes this for CreatorExpression and also for VariableExpression in the result clause