graeder wrote:
If I have a simple delete statement, that doesn't map to a pojo, can I use createSQLQuery to execute it? Or, do I have to obtain a connection from the session?
ex. String sql = "delete * from employee where emplid= :emplid";
getSession().createSQLQuery(sql).setString("emplid",emplid);
Will createSQLQuery always execute the query?
createSQLQuery doesn't execute the query. And the proper syntax would be "delete from employee where emplid = :emplid" ( No * )
Look at the bottom of page 132 in the 3.0.5 docs for an example using a pojo. I don't think you can use Hibernate when not using a mapped pojo.