Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » JPQL validation error: AS in SELECT (with constructor expession)
JPQL validation error: AS in SELECT (with constructor expession) [message #900219] Sun, 05 August 2012 17:16 Go to next message
Karsten Wutzke is currently offline Karsten WutzkeFriend
Messages: 112
Registered: July 2009
Senior Member
Hello,

I'm having troubles with Dali JPQL validation (again).

I asked over at SO here: http://stackoverflow.com/questions/11807738/jpa-jpql-as-identifier-disallowed-in-select-clause

Why is SELECT ... AS ... showing validation errors in Dali?:
index.php/fa/11036/0/
Errors at the line 426:
Multiple annotations found at this line:
	- The identification variable 'AS' cannot be a reserved word.
	- The identification variable 'tipoff' is not defined in the FROM clause.
	- The constructor expression has two constructor items ('AS' and 'tipoff') that are not separated by a 
	 comma.
	- The constructor expression has two constructor items ('CASE WHEN ga.actualTipoff IS NOT NULL 
	 THEN ga.actualTipoff ELSE ga.scheduledTipoff END' and 'AS') that are not separated by a comma.
	- The identification variable 'AS' is not defined in the FROM clause.
The 2nd to last example at http://en.wikibooks.org/wiki/Java_Persistence/JPQL_BNF#New_in_JPA_2.0 shows it should work.

Also note the ORDER BY in the query, which is the main purpose of this aliasing.

What's wrong here (or with Dali)?

Karsten

[Updated on: Sun, 05 August 2012 17:41]

Report message to a moderator

Re: JPQL validation error: AS in SELECT (with constructor expession) [message #900407 is a reply to message #900219] Mon, 06 August 2012 21:25 Go to previous message
Pascal Filion is currently offline Pascal FilionFriend
Messages: 5
Registered: July 2009
Location: Raleigh, NC
Junior Member
Hi Karsten,

It is true JPA 2.0 added support to identify a select expression with a result variable but the spec does not allow to use it inside of a select item. That means the first CASE expression defined as a constructor item cannot be identified with a result variable. In your query, a result variable can only be used to identify the entire constructor expression.

I hope this helps.
Previous Topic:JPQL validation error: well-formed character data or markup
Next Topic:Status of how users with multiple projects should use dali/persistence.xml and <jar-file >
Goto Forum:
  


Current Time: Mon Dec 22 02:04:36 GMT 2014

Powered by FUDForum. Page generated in 0.02021 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software