I always get the error too many Columns when i execute this query.
SELECT o FROM Overlay o WHERE ( :coordinate ) IN ELEMENTS(o.blocksCoordinates)
If i do it in sql it works:
Select * from Overlay overlay0_ where (0,0) in (select x, y from ...
Coordinate is a simple embedded entity with an x and y value.
@ElementCollection
private Set<Coordinate> blocksCoordinates = new HashSet<Coordinate>();
My Coordinate entity:
@Embeddable
public class Coordinate implements Serializable {
private static final long serialVersionUID = -5866341829302555966L;
protected int x;
protected int y;
What am I doing wrong?
Try it the other way round:
Or using the
withkeyword:Using that query should return any Overlay for which the join on c = coordinate succeeded.
Edit: Alternatively, try to use the x and y values: