-->
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.  [ 1 post ] 
Author Message
 Post subject: Problem with hibernate caching?
PostPosted: Wed Sep 26, 2007 10:16 am 
Newbie

Joined: Wed Jul 04, 2007 9:06 am
Posts: 12
Hi all.

I have a problem...

I'm trying to retrieve a Survey object from the database which has a one to many mapping onto an object called SurveyQuestion.

There are multiple sets of SurveyQuestions based on locale for each Survey.

Thus I am trying to do this:


Code:
List<Survey> surveys = entityManager.createQuery("SELECT DISTINCT s FROM " + Survey.class.getSimpleName() + " s LEFT JOIN FETCH s.surveyQuestions q WHERE q.locale = '" + locale + "'").getResultList();


In an attempt to get back a Survey object which has a set of questions for the given locale.

I do this twice within the same loop, for locale of 'fr' and 'en'.
Both Survey objects contain the 'fr' SurveyQuestions not 'fr' and 'en'.

Am I doing something wrong, or is this some kind of caching problem?

I'm using JBoss 4.2.1GA...


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

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.