I am new to JPA.
I have found how to use JPA criteria API in the below link: JPA Criteria API with multiple parameters
The code for predicate is:
Root<CustomerEntity > customerEntity = cq.from(CustomerEntity.class);
List<Predicate> predicates = new ArrayList<Predicate>();
//Adding predicates in case of parameter not being null
if (param1 != null) {
predicates.add(
qb.equal(customerEntity.get("fieldName"), param1));
}
But my customer entity class has a embeddable id (composite primary key)
How can I use JPA criteria API in this scenario
Are all the embeddable id object values mandatory for searching as well(Select query)?