Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

IllegalArgumentException NamedQuery not found

17473May 28 2009 — edited May 28 2009
Hello,

I define my metadata natively in TopLink i.e. using the TopLink Workbench I define the following files:

- session.xml
http://perfectjpattern.svn.sourceforge.net/viewvc/perfectjpattern/trunk/perfectjpattern-eclipselink/src/test/resources/sessions.xml?view=markup

- PersonProject.xml
http://perfectjpattern.svn.sourceforge.net/viewvc/perfectjpattern/trunk/perfectjpattern-eclipselink/src/test/resources/ExampleProject.xml?view=markup

PersonProject.xml includes couple of named queries depicted in the link above "Person.findByName" and "Person.findByAge" that I use to test both Named query with positional and named argument matching respectively.

I load the project using TopLink native interfaces and immediately switch to JPA interfaces, I do that using the following code:
http://perfectjpattern.svn.sourceforge.net/viewvc/perfectjpattern/trunk/perfectjpattern-eclipselink/src/main/java/org/perfectjpattern/jee/integration/dao/EclipseLinkSessionStrategy.java?view=markup

My problem is that I continuously get the "IllegalArgumentException NamedQuery not found" exception. It happens only when trying to set the value of a parameter.

The exception happens in the following file in line 159 and not in 153 so the query seems to be found but when assigning the argument values it throws the IllegalArgumentException:
http://perfectjpattern.svn.sourceforge.net/viewvc/perfectjpattern/trunk/perfectjpattern-jee/src/main/java/org/perfectjpattern/jee/integration/dao/JpaBaseDao.java?view=markup#l_138

The project provides Base and Generic Dao implementations. This issue of named queries is the last bit left to have an EclipseLink implementation of the Generic Dao.

Thanks in advance,
Best regards,
Giovanni

Edited by: bravegag on 28.05.2009 04:05
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 25 2009
Added on May 28 2009
1 comment
1,680 views