Consider the following Entity :
@Entity
public class Parent{
@Column
private String name;
@ElementCollection
@CollectionTable(name="REF_TABLE",joinColumns=@JoinColumn(name="REF_COLUMN_ID"))
@Column(name="REF_COLUMN_VALUE")
public Set<String> getValues() {
return values;
}
}
I need to implement JPA criteria where clause for "UPPER(REF_COLUMN_VALUE) IN (?values)"
So far I have :
root.joinSet(Parent_.values, JoinType.LEFT).in(collectionOfValues)
How can I apply UPPER function for each element in values ?
I know I can achieve this by defining and wrapping String value as @Embeddable class, that would give me meta-attribute for value property and I could do :
joinSet = root.joinSet(Parent_.values, JoinType.LEFT);
criteriaBuilder.isMember(criteriaBuilder.upper(joinSet.get(WrapedString_.value)),criteriaBuilder.literal(collectionOfValues))
Can I do it without introducing the wrapper ?
Thanks