JobEntityManager.java 文件源码

java
阅读 38 收藏 0 点赞 0 评论 0

项目:osc-core 作者:
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);
        }
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号