a5sk4s wrote:
Use hibernate.show_sql true in either hibernate.properties or the corresponding XML syntax in hibernate.cfg.xml
I already have that and this is what I see in the console
The reason why I want to see this is I am not able to retrieve an Object and I thought looking at the sql would a starting point and then I can move on further.
Code:
public Panel loadByName(final String name) {
return (Panel) getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException {
String query = " from Panel p where p.name = :name ";
Query queryObject = session.createQuery(query);
queryObject.setString("name", name);
List panels = queryObject.list();
// the list that i got back is null.
return null;
}
});
}
this is what i see in console.
Code:
10:35:46,758 INFO [STDOUT] Hibernate: select panel0_.OBJECTID as OBJECTID, panel0_.LOCKVERSION as LOCKVERS2_, panel0_.CREATION_DATE as CREATION3_, panel0_.NAME as NAME, panel0_.TITLE as TITLE from PANEL2 panel0_ where (panel0_.NAME=? )
10:36:48,637 INFO [STDOUT] Hibernate: select panel0_.OBJECTID as OBJECTID, panel0_.LOCKVERSION as LOCKVERS2_, panel0_.CREATION_DATE as CREATION3_, panel0_.NAME as NAME, panel0_.TITLE as TITLE from PANEL2 panel0_ where (panel0_.NAME=? )
see that the place holder is not replaced with what ever String that I had set it to?