ComputationLogRepositoryImpl.java 文件源码

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

项目:xsharing-services-router 作者:
@Override
public ComputationLog findLog(DateTime timestamp) throws DatabaseException {
    // find log by time stamp
    CriteriaBuilder cb = entityManager.getCriteriaBuilder();
    CriteriaQuery<ComputationLog> c = cb.createQuery(ComputationLog.class);
    Root<ComputationLog> log = c.from(ComputationLog.class);
    c.where(cb.equal(log.get(ComputationLog_.timestamp), timestamp));
    TypedQuery<ComputationLog> query = entityManager.createQuery(c);

    try {
        return query.getSingleResult();
    } catch (RuntimeException e) {
        throw new DatabaseException(e.getMessage());
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号