Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Hibernate 3.2 cr4
Hi all, allow my code to explain:
Code:
String strQuery = "select assetsScenarios "
+ "from Asset myasset "
+ "LEFT JOIN myasset.assetsScenarios assetsScenarios "
+ "WHERE myasset.id = :assetID "
+ "Order by assetsScenarios.includeScenario desc";
Query query;
query = getSession().createQuery(strQuery);
query.setParameter("assetID", assetID);
List <Assetscenario> scenarioList = query.list();
Set<Assetscenario> assetsScenarios = new HashSet<Assetscenario>(0);
Boolean wtf = assetsScenarios.addAll(scenarioList);
logger.debug("WTF bool: " + wtf);
So I want to return a Set instead of List. The code works, except that the List follows the 'Order by' clause semantics, but the Set does not. The boolean shows true. Any ideas ?
Robert