-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Null pointer for elementcollection query
PostPosted: Wed Apr 06, 2011 10:37 am 
Beginner
Beginner

Joined: Wed Mar 05, 2008 10:32 am
Posts: 48
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!


Top
 Profile  
 
 Post subject: Re: Null pointer for elementcollection query
PostPosted: Tue Apr 19, 2011 11:33 am 
Beginner
Beginner

Joined: Wed Mar 05, 2008 10:32 am
Posts: 48
Sorry for the bump, but i'm still looking for a solution.. anyone?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.