I am newbie to Hibernate criteria and I got problem with simple obtain class. Assume we have classes:
Class A{
int id;
List<A> aList;
}
and:
Class B{
A a;
(...)
}
and :
Class C{
int id;
String name;
B b;
}
I want to get List< C > if 'name' like 'abc'. Here is my criteria code:
Session session = hibernateTemplate.getSessionFactory().getCurrentSession();
Criteria crit = session.createCriteria(C.class);
crit.add(Restrictions.like("nazwa", "%"+string+"%").ignoreCase());
return crit.list();
I got exception:
org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
In my SQL query generated by criteria I can see "left outer join" on my A and B classes that are contained in my C class. Probably that's why I cannot load