public Long getTaskCount(Long jobId) throws InterruptedException, VmidcException {
try {
EntityManager em = this.dbMgr.getTransactionalEntityManager();
return this.dbMgr.getTransactionControl().required(() -> {
String hql = "SELECT count(*) FROM TaskRecord WHERE job_fk = :jobId";
TypedQuery<Long> query = em.createQuery(hql, Long.class);
query.setParameter("jobId", jobId);
return query.getSingleResult();
});
} catch (ScopedWorkException swe) {
throw swe.as(RuntimeException.class);
}
}
JobEntityManager.java 文件源码
java
阅读 38
收藏 0
点赞 0
评论 0
项目:osc-core
作者:
评论列表
文章目录