hi-
my latest project is to add expanded category views in a tree
structure for my checkbook program found at
www.3rdshiftcoder.com it seems that part of this query is mapped to a class but
the data from the rest of it is in java.util.List lst = query.list()
i cant figure how to get at the data in the lst so i can
build my tree structure!
can someone please help? code below:
tx = session.beginTransaction();
Query query = session.createSQLQuery("select {c.*} "+
",down1.description as down1 "+
",down2.description as down2 "+
",down3.description as down3 "+
"from CATEGORY as c "+
" left outer join CATEGORY as down1 on down1.parentid = c.categoryid" +
" left outer join CATEGORY as down2 on down2.parentid = down1.categoryid" +
" left outer join CATEGORY as down3 on down3.parentid = down2.categoryid " +
"where c.PARENTID is null "+
"order by c.description, down1, down2, down3")
.addEntity("c",Category.class);
System.out.println("before");
java.util.List lst = query.list();
for ( Iterator iter = lst.iterator();
iter.hasNext(); ) {
Category mycat = (Category) iter.next();
System.out.println(mycat.getCategoryid() + " mstr");
// i can get values out of mycat but need them out of the lst too!
//cant seem to go from a List value to a
string //i posted this in hibernate forum in case someone needed to understand the query and the issue.
thanks for any assistance,
jim