I created a
jsp page with a text field.According to the text entered in the field the database is searched using hibernate. The datbase has a field name. It will search the dbs for name that matches the entered name. The criteria query for this will be which one from these?
Criteria criteria = session.createCriteria(Hello.class)
.add(Restrictions.eq(name, "%"));
.add(Restrictions.eq("name", name));
.add(Restrictions.eq(name, "name%"));
.add(Restrictions.eq("id", new Integer(0)));
.add(Restrictions.ilike("name", "%",MatchMode.ANYWHERE));