This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 235210 - @NamedQuery expression type parse error
Summary: @NamedQuery expression type parse error
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.3.1
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on: 232018
Blocks:
  Show dependency tree
 
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
Exception Reporter:


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