最近应公司要求,全体员工转Java开发,只能临时抱佛脚了,学点记点。
public static List<Tcuser> search(String user,String type) {
TypedQuery<Tcuser> query = entityManager().createQuery("SELECT o FROM Tcuser o where o.user like :user and o.type=:type", Tcuser.class);
query.setParameter("user","%"+user+"%");
query.setParameter("type",type);
return query.getResultList();
}