I am having trouble getting the hibernate criteria to execute, here is my code
Session session = HibernateFactory.openSession();
Criteria criteria = session.createCriteria(Title.class);
criteria.add(Restrictions.like( "TITLE.title", "W%" ));
List titles = criteria.list();
When I check the size of titles, it prints 0, but, when I do
org.hibernate.Query query2 = session.createSQLQuery( "SELECT * FROM TITLE WHERE TITLE.title LIKE 'W%'");
List<Title> list2 = query2.list();
and check the size of list2 I get 1, what am I doing wrong?
Edit 1: Also my sql_show is set to true, in the 1st case it does not print the query, while in the second case it does, I need to solve this too.
Should do what you’re looking for