|
LOGGER.debug(DataFetcherUtil.class, "quering data base.the sql is:"+sql);
Session session = HibernateSessionFactory.currentSession();
SQLQuery query = session.createSQLQuery("select max(id) as id0_, max(date) as date3_0_ from tradingday");//.addEntity("securityId", Security.class);
Set <String> keys = entities.keySet();
Class clazz = null;
for(String key:keys){
clazz = entities.get(key);
query.addEntity(key, clazz);
}
return query.list();
You can see the sql now that works. If i ommit the id0_ and date3_0_ it doesn't work
thanks,
Ziv
|