日期:2014-05-17 浏览次数:20650 次
public List<DelStorageInventory> findByUPC(String upc) {
if (upc == null) {
return null;
}
String hql = "select delStorageInventory from DelStorageInventory delStorageInventory where lower(delStorageInventory.upc) like lower(:upc)";
try {
return this.entityManager.createQuery(hql, DelStorageInventory.class).setFlushMode(FlushModeType.COMMIT).setParameter("upc", "%"+upc).getResultList();
} catch(NoResultException e) {
// TODO: handle exception
}
return null;
}
public List<DelStorageInventory> findByMemberUPC(Member member, String upc) {
//通过member和upc查询返回List集合
//求代码,
}
String hql="sql语句";
Query query = entityManager.createQuery(hql,?DelStorageInventory.class);
query.setPameter('属性', member.属性);