Tutorial by Examples

Assuming you have a handle on the Hibernate Session object, in this case named session: List<Object[]> result = session.createNativeQuery("SELECT * FROM some_table").list(); for (Object[] row : result) { for (Object col : row) { System.out.print(col); } } Thi...
Object pollAnswered = getCurrentSession().createSQLQuery( "select * from TJ_ANSWERED_ASW where pol_id = "+pollId+" and prf_log = '"+logid+"'").uniqueResult(); with this query, you get a unique result when you know the result of the query is always going to b...

Page 1 of 1