try {
s.beginTransaction();
String hql = "from Car a "+
"where a.id=? ";
List carlist = s.createQuery(hql)
.setInteger(0, 101)
.list();
StringBuffer sb = new StringBuffer();
for(Car car1 : (List
sb.append(car1.getId() + ":");
sb.append(car1.getType()+"\n");
}
System.out.println(sb.toString());
----------------------------
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Hibernate: select car0_.OID as OID0_, car0_.ID as ID0_, car0_.MAKE as MAKE0_, car0_.TYPE as TYPE0_, car0_.COL as COL0_ from t_car car0_ where car0_.OID=?
--------------------------------
请问为什么无法显示查询结果?