I am having hibernate call to get the data from the table. I am writing the following code :
List<TABLENAME> list = HibernateSessionFactory.getSession().createCriteria(TABLENAME.class).
add(Restrictions.isNull("column3")).
add(Restrictions.eq("column4",groupId)).list();
But while running I m getting CastException
Can anyone pls help to do the fix? I dont know why it needs to cast to integer?
Entity Class :
public class TABLENAME {
private Timestamp column3;
private int column4;
Getter and setters of the above variables.
}
add(Restrictions.eq("column1",0)).add(Restrictions.eq("Column2",1))
Either your "column1" is of type varchar or your "Column2" is of type varchar.
Or
add(Restrictions.eq("column4",groupId)
groupId is not an int...if your column4 is.