-->
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: Errors: undefined alias:...
PostPosted: Mon May 17, 2004 9:51 am 
Newbie

Joined: Fri May 14, 2004 12:18 pm
Posts: 10
I got the following errors 4 time. There are 4 records in the DEPT table.

omain.Dept]
07:59:11,177 DEBUG - [ora.EmpDaoSql.findListDept] net.sf.hibernate.QueryExceptio
n: undefined alias: DEPTNO [SELECT DEPTNO, DNAME FROM edu.umich.umms.my_spring.d
omain.Dept]

My code is:------------------------------------------------------
String sqlString =
"SELECT DEPTNO, DNAME FROM Dept";

Session sess = getSession();

try {
resultList = sess.find(sqlString);
if (resultList != null) {
lst = new ArrayList();
}
for (it = resultList.iterator(); it.hasNext();) {
dept = (Dept)it.next();
nv = new NameValue(""+dept.getDEPTNO(), dept.getDNAME());
System.out.println(dept.getDEPTNO() +":"+ dept.getDNAME());
lst.add(nv);
}

return lst;
} catch (Exception e) {
LOGGER.debug(e.toString());
return null;
}
}
---------------------------------------------------
I don't wnat to use find("FROM dept") because I don't want to select all fields per records.

-Henry


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.