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: Help w/ an HQL Query
PostPosted: Fri Jul 22, 2005 3:02 pm 
Newbie

Joined: Thu Jul 07, 2005 2:14 pm
Posts: 6
My query is this:
String queryString =
"select destination, routeTraversal " +
"from " + TransportRole.class.getName() + " transportRole " +
"join transportRole.macroEntityTransfers entity " +
"join entity.origin origin " +
"join entity.destination destination " +
"join transportRole.trips trip " +
"join trip.childActions routeTraversal " +
"where (trip.startTime >= :startTime and trip.endTime <= :endTime) or "+
"(trip.startTime >= :startTime and trip.startTime < :endTime) "+
"and (origin.objectKey = :thisKey) " +
"and (destination.objectKey in (" + value + ")) " +
"and (routeTraversal.class = :routeElementTraversal) " +
"group by destination.name";

List traversals = session.createQuery(queryString).
setParameter("thisKey", storageContainerRoleID).
setLong("startTime", startTime).
setLong("endTime", endTime).
setParameter("routeElementTraversal", RouteElementTraversal.class.getName()).
list();



The query works correctly when 'value' only has one objectKey. However, when it has more than that, it only selects one of the destinations and its routeTraversal. Does anyone know why this is? Thanks for the help.


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.