hibernate中integer门类模糊查询的技巧

hibernate中integer类型模糊查询的技巧把integer类型映射成string类型,利用like对字符串的hql模糊查询。比

hibernate中integer类型模糊查询的技巧
把integer类型映射成string类型,利用like对字符串的hql模糊查询。

比如对vo中定义的integer主键进行模糊查询:
<id
            name="estId"
            column="EST_ID"
            type="java.lang.Integer"
        >
<generator and a.strId like:estId" );
countSql.append( " and a.strId like:estId" );
pars.put( "estId", '%'+ model.getEstName()+'%');

附注:java中判断输入文字是数字的方法:
Pattern pattern = Pattern.compile("[0-9]*");
if(pattern.matcher(model.getEstName()).matches())
{
   满足条件……
}