Hello,
I'm using Java Persistence and Jboss.
I have an entity with a composite primary key (pk.root, pk.extension) and when I try to query for multiple istances of the pk I get a "java.sql.sqlexception: No value specified for parameter 4" error.
The EJBQL query has the following where clause: WHERE Entity.pk = ?1 or Entity.pk = ?2
Then I set the two parameters (entitypk1 and entitypk2 are two istance of the primary key composite object): query.setParameter(1, entitypk1); query.setParameter(1, entitypk2);
This produces an Hibernate query as follows: where (ENTITY_PK_ROOT, ENTITY_PK_EXT) = (?, ?) OR (ENTITY_PK_ROOT, ENTITY_PK_EXT) = (?, ?)
which, as said, produces a: java.sql.sqlexception: No value specified for parameter 4
Any idea?
Thanks, Umberto
|