Here is the existing code and i need to pass the List of order types instead of one orderType. And this specification is already added to the where clause of existing search query.
How to modify the existing specification for the IN clause ?
public static Specification<OrderEntity> addReference(String orderType, String refNum) {
return (root, query, builder) -> {
if (null != refType && null != refNum) {
Join<OrderEntity, OrderDetailEntity> orderSearchJoin =
root.join(OrderEntity_.orderDetailEntityList);
query.distinct(true);
return builder.and(
builder.equal(orderSearchJoin.get(OrderDetailEntity_.orderType), orderType),
builder.equal(orderSearchJoin.get(OrderDetailEntity_.referenceNum), refNum));
} else {
return null;
}
};
}