You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Bob Schellink <sa...@gmail.com> on 2018/08/07 08:40:30 UTC
Cannot map database-generated primary Key in modeler
Hi all,
We have a JPA project where table primary keys are database generated.
The following JPQL query is common:
update Table t set t.status = :status where f.ID in (:ids)
Basically an update query where primary key (ID) is in a given list.
In the modeler when I map the primary key on the entity the project does
not validate with:
ObjAttribute 'id' is mapped to a generated PK: id
Just wondering if his intentional?
Seems I can workaround the issue by adding db: prefix:
update Table t set t.status = :status where db: f.ID in (:ids)
Not sure if this is the best option though?
Kind regards
Bob