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 240499 - Wrong warning regarding a correct Expression (JPQL)
Summary: Wrong warning regarding a correct Expression (JPQL)
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-15 14:21 UTC by Juergen.Zimmermann
Modified: 2014-01-23 11:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Testcase with named query (114.66 KB, application/x-zip-compressed)
2014-01-15 14:33 UTC, Juergen.Zimmermann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen.Zimmermann 2014-01-15 14:21:23 UTC
I'm having the following named query which works fine (WildFly 8.0.0.CR1/Hibernate 4.3.0). However, I'm getting the warning "The expression at index 1 is not a valid expression. The expression at index 2 is not a valid Expression.". Index 1 refers to the string "Privatkunde", and index 2 to the sting "Firmenkunde". Both are class names of @Entity classes being derived from the abstract @Entity class AbstractKunde.

@NamedQuery(name = AbstractKunde.FIND_PRIVATKUNDEN_FIRMENKUNDEN,
	    query = "SELECT   k"
	            + " FROM  AbstractKunde k"
	 	    + " WHERE TYPE(k) IN (Privatkunde, Firmenkunde)")
Comment 1 Juergen.Zimmermann 2014-01-15 14:33:42 UTC
Created attachment 143985 [details]
Testcase with named query

In the Maven-ized project (src/main/java) you find the class de.shop.kundenverwaltung.AbstractKunde. The named query is at line 140.
Comment 2 Sergey Petrov 2014-01-17 11:21:48 UTC
depends on eclipselink, but may be I'll change general jpql grammar to eclipselink jpql as a workaround
Comment 3 Juergen.Zimmermann 2014-01-17 13:24:48 UTC
Sergey, I'm using Hibernate - not EclipseLink
Comment 4 Sergey Petrov 2014-01-17 13:49:48 UTC
validation is done by nb and it means by bundled eclipselink
Comment 5 Juergen.Zimmermann 2014-01-17 14:12:17 UTC
When you look into the JPA spec chapter 4.6.17.5, then you'll see several examples for so-called "Entity Type Expressions".
Comment 6 Juergen.Zimmermann 2014-01-17 14:17:39 UTC
There was an EclipseLink bug which was resolved in the past: https://bugs.eclipse.org/bugs/show_bug.cgi?id=249224
Comment 7 Sergey Petrov 2014-01-20 11:42:09 UTC
next issue is filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=426109
Comment 8 Quality Engineering 2014-01-21 02:56:37 UTC
Integrated into 'main-silver', will be available in build *201401210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/6cb88656aa37
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #240499 temporary workaround
Comment 9 Sergey Petrov 2014-01-21 12:52:45 UTC
can be considered as fixed, but need to revert fix if the issue will be fixed in 2.5.2 and it will be bundled
Comment 10 Juergen.Zimmermann 2014-01-23 11:14:36 UTC
Confirmed: the issue is gone in build 20140123001