Troubleshooting
Problem
If the user is generating JPA query methods into a JPA Manager Bean and those queries contain composite foreign key values as filter parameters the generated methods will not have input parameters.
Symptom
Example:
If the query looks like: "SELECT e FROM Employee e WHERE e.department.pk.deptName = :department_pk_deptName"
Where pk.deptName is a field in an embedded composite key class.
Then the query method will be generated as follows:
@NamedQueryTarget("getEmployeeByDepartment")
public List<Employee> getEmployeeByDepartment() {
EntityManager em = getEntityManager();
List<Employee> results = null;
try {
Query query = em.createNamedQuery("getEmployeeByDepartment");
results = (List<Employee>) query.getResultList();
} finally {
em.close();
}
return results;
}
Notice the missing input parameters in the method signature.
Log InLog in to view more of this document
Was this topic helpful?
Document Information
Modified date:
16 June 2026
UID
swg21319555