在ejb-jar.XML下加入如下代码:
< entity
.......
< query
< query-method
< method-namefindByNameLike< /method-name
< method-params
< method-paramJava.lang.String< /method-param
< /method-params
< /query-method
< ejb-ql /
< /query
< /entity
在jbosscmp-jdbc.xml下加入如下代码:
< entity
......
< query
< query-method
< method-namefindByNameLike< /method-name
< method-params
< method-paramjava.lang.String< /method-param
< /method-params
< /query-method
< jboss-qlselect object(c) from County as c where c.name like concat('%',concat(?1,'%')) order by c.id desc< /jboss-ql
< /query
< /entity