hi,is there someone tell me when Query.list() return proxy??
I had a problem,my code is below
Code:
@SuppressWarnings("unchecked")
public List<Template> find(String hql, Object... values) {
Query q = createQuery(hql, values);
return q.list();
}
the createQuery method is:
Code:
/**
*
* @param hql
* @param values
* @return
*/
protected final Query createQuery(String hql, Object... values) {
Query query = getSession().createQuery(hql);
if (null != values) {
for (int i = 0; i < values.length; i++) {
query.setParameter(i, values[i]);
}
}
return query;
}
after call find() method,will auto commit the session.
i use the find() in struts action,but it return a list of proxy,and the proxy's initialized is true.
the template object has id,name,content property,id is the primary key,in web page,it can get the name,but cann't get the id...
i am very very puzzle.thanks you reply