I have entity with this field:
//on main entity
@OneToMany(mappedBy="minutisPreke", targetEntity=MinutisPrekeTiekejas.class, fetch=FetchType.EAGER, cascade = CascadeType.ALL)
private List<MinutisPrekeTiekejas> tiekejai;
//inverse join of MinutisPrekeTiekejas entity
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="tiek_id")
private MinutisTiekejas minutisTiekejas;
I am building criteria query where I need to check if this entity contains MinutisPrekeTiekejas
object with id in array Constants.ID_ARRAY
Something like this (this don't look right and doesn't work, just the priciple):
...
//predicates is a predicate array
predicates.add(from.get("tiekejai").get("tiekId").in(Constants.ID_ARRAY));
...