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