Joined: Wed Jul 25, 2007 7:46 am Posts: 4
|
How come this simple order by does not work? Here is the code
Session session = f.openSession();
Transaction tx = session.beginTransaction();
classIds=new HashSet();
List result=null;
result = session.createQuery("FROM KClassIds order by classId").list();
Iterator iter = result.iterator();
while (iter.hasNext())
{
if(debug) System.out.println("BClassIds:Loading KClassIds");
KClassIds tkcids = (KClassIds) iter.next();
KClassIds kcids=new KClassIds();
kcids.setClassId(tkcids.getClassId());
kcids.setName(tkcids.getName());
kcids.display();
classIds.add(kcids);
}
session.close();
Here is the mapping
<class name="KClassIds" table="classes">
<id name="classId" column="class_id" type="string" length="180"></id>
<property name="name" column="name" type="string" length="240"/>
</class>
Any/all help greatly appreciated, thanks in advance!
jim s
|
|