You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Patrick T <so...@hotmail.com> on 2008/02/06 17:16:49 UTC
Parse Exception error
Hello,
I'm trying to setup a named query within jpa and for some reason, it keeps
on giving me a ParseException although, the jpql is correct. the named query
is below:
@NamedQuery(name="getUnassignedMachine", query = "SELECT m FROM Machine m
LEFT JOIN Machineuser m1 WHERE m1.person_id IS NOT NULL")
To fetch, the code is below:
@NamedQueryTarget("getUnassignedMachine")
public List<Machine> getUnassignedMachine(int persId){
EntityManager em = getEntityManager();
List<Machine> results = null;
try {
Query query= em.createNamedQuery("getUnassignedMachine");
results= (List<Machine>)query.getResultList();
}finally {
em.close();
}
return results;
}
I get the following error:
An error occurred while parsing the query filter 'SELECT m FROM Machine m
LEFT JOIN Machineuser m1'. Error message: <openjpa-1.0.1-r420667:592145
nonfatal user error> org.apache.openjpa.kernel.jpql.ParseException:
Encountered "LEFT JOIN Machineuser m1" at character 25, but expected: [".",
"FETCH", "INNER", "JOIN", "LEFT", "OUTER", <IDENTIFIER>].
--
View this message in context: http://www.nabble.com/Parse-Exception-error-tp15306761p15306761.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.