JPQL: Update fails using external object param

#1

Let's suppose we have two objects and one is the key to another:

Language{id:Integer,language: String} Book{id:Integer, title: String, language: Language}

This select works:

SELECT b from Book b where b.language.language="en" // it returns some records

But when I use the same condition for an UPDATE query:

UPDATE Book b set b.title="aaaa" where b.language.language="en"

It returns the following error:

Query Execution Error 
===================== 
null
#2

Path expressions, such as b.language.language, are implemented using JOIN, and unfortunately JOIN is not supported in JPQL UPDATE queries.

A better error message should be produced by ObjectDB.

See also this forum thread.

 

ObjectDB Support

Reply