java - Hibernate Criteria, Integer and "like" -


I am migrating some of my certain HKL-statements to Criterias. Now I am finding a problem: unit property Type is integer, but I need a way with wildcard searching, so in hkl I

  session.createQuery ("id from p1: id"). SetString ("id", "%" + s +     ex>  string can not be entered for integer criteria crit = sessionFactory.getCurrentSession ( ). CreateCriteria (P1.class); crit.add (Restrictions.like ("id", s)) addOrder (Order.asc ("id")) setMaxResults (maxResults) ..  
< P> Why does hibernate handle both situations differently?

You can use. It has no meaning.

str where like string (id: id "). SetString (" id " , "%" + S + "%")

if your If it is not near then it will be quite slow column.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -