I'm trying to query on an elementcollection set but the line with the query is throwing a null pointer exception.
Code:
//Venue Entity
@ElementCollection(fetch = FetchType.LAZY)
public Set<Rating> getAtmosphereRatings() {
return atmosphereRatings;
}
// Rating Embeddable
private Long owner;
private int value;
Code:
Query q = getSession().createQuery("SELECT atmosphereratings.value as rating FROM Venue as v WHERE v.id=? and atmosphereratings.owner=?");
This would be so easy if hibernate would let me do a manual query but querying the venue_atmosphereratings table that hibernate created was not allowed by createQuery or createSQLQuery.
Any feedback would be great!