Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 235210 - @NamedQuery expression type parse error
@NamedQuery expression type parse error
Status: RESOLVED FIXED
Product: javaee
Classification: Unclassified
Component: Persistence
7.3.1
PC Windows 7 x64
: P3 (vote)
: 8.0
Assigned To: Sergey Petrov
issues@javaee
:
Depends on: 232018
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-29 07:54 UTC by matsa
Modified: 2014-07-09 15:06 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
Simple EE7 project with single entity containing single self-joining query (2.99 KB, application/x-zip-compressed)
2013-08-29 09:43 UTC, matsa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matsa 2013-08-29 07:54:10 UTC
I've recently been converting some HQL expressions into @NamedQuery (the JPA kind).

Here's an example:

SELECT c.name FROM Connection AS c WHERE c.key = :key AND c.validTo = (SELECT MAX(c2.validTo) FROM Connection AS c2 WHERE c2.key = :key )

This query works as it should before and after the conversion but the editor indicates the following error:

"The left and right expressions type must be of the same type".

If I remove the MAX() around c2.validTo the message goes away (and breaks my query of course). Perhaps that fact can help locate the error?
Comment 1 Sergey Petrov 2013-08-29 08:12:09 UTC
Can you provide a sample with entities code also?
Comment 2 matsa 2013-08-29 09:43:32 UTC
Created attachment 139417 [details]
Simple EE7 project with single entity containing single self-joining query

Simple EE7 project with single entity containing single self-joining query.
Comment 3 Sergey Petrov 2013-09-04 08:47:25 UTC
thanks, nice sample
Comment 4 Sergey Petrov 2013-09-04 20:17:13 UTC
depends on https://bugs.eclipse.org/bugs/show_bug.cgi?id=416546
Comment 5 Sergey Petrov 2013-10-01 16:38:25 UTC
http://hg.netbeans.org/web-main/rev/2503cb719727 2.5.1


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo