提交 5fcf1424 编写于 作者: M MaxKey

Update JpaService.java

上级 707c8c1d
......@@ -268,6 +268,21 @@ public class JpaService <T extends JpaEntity> {
return Collections.emptyList();
}
/**
* load entity by Query
* @param entity
* @return
*/
public T load(Query query) {
try {
List<T> loadList = query(query);
return CollectionUtils.isEmpty(loadList) ? null : loadList.get(0);
} catch(Exception e) {
logger.error("load One Exception " , e);
}
return null;
}
/**
* findAll from table
* @return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册