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: NUCJPA-240
Type: Improvement Improvement
Status: Closed Closed
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Unassigned
Reporter: Matthew T. Adams
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus API JPA

Separate namespaces of type aliases and named parameters

Created: 11/Jun/13 03:47 PM   Updated: 06/Apr/16 07:20 PM   Resolved: 29/Mar/16 10:27 AM
Component/s: None
Affects Version/s: 3.2.2, 3.2.3
Fix Version/s: None

From mvn dependency:tree
[INFO] +- org.datanucleus:datanucleus-accessplatform-jpa-rdbms:pom:3.2.2:compile
[INFO] | +- javax.jdo:jdo-api:jar:3.0:compile
[INFO] | | \- javax.transaction:transaction-api:jar:1.1:compile
[INFO] | +- org.datanucleus:datanucleus-core:jar:3.2.3:compile
[INFO] | +- org.datanucleus:datanucleus-api-jpa:jar:3.2.2:compile
[INFO] | +- org.datanucleus:datanucleus-jpa-query:jar:3.0.2:compile
[INFO] | \- org.datanucleus:datanucleus-rdbms:jar:3.2.2:compile

Forum Thread URL:,7538
Datastore: Apache Derby
Severity: Test/Acceptance

 Description  « Hide
The query "SELECT u FROM User u WHERE LOWER(u.username) = :u" causes DataNucleus to throw:

java.lang.IllegalArgumentException: Parameter u needs to be assignable from app.domain.model.User yet the value is of type java.lang.String
at org.datanucleus.api.jpa.JPAQuery.setParameter(
at org.datanucleus.api.jpa.JPAQuery.setParameter(

This suggests that DN is combining the namespaces of type aliases and named parameters, which I think should be separate.

Test case will follow after I get issue number.

Sort Order: Ascending order - Click to sort in descending order
Matthew T. Adams added a comment - 11/Jun/13 04:21 PM - edited
Reproducible test case on branch NUCJPA-240 at matthewadams/test-jpa (

Andy Jefferson added a comment - 11/Jun/13 05:24 PM
In Java you wouldn't be able to have one variable called "u" of type "mydomain.User" and another variable called "u" of type "String", consequently that's why we don't allow it. Obviously if you want such a thing a patch is the way to contribute it.

Matthew T. Adams added a comment - 11/Jun/13 05:31 PM
Ah, yes, but JPQL is not even attempting to be Java. As such, the namespaces of type aliases & named parameters should still be separate.

I might agree with you if we were talking JDOQL... :)

Simple workaround. I didn't realize that I took the default priority of "Major". I agree that it's minor.

Andy Jefferson added a comment - 29/Mar/16 10:27 AM
No interest in this. People can contribute pull requests should they want such a thing, but then in the 3 yrs since this was raised nobody else thinks it required