PaymentDaoImpl.java 文件源码

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

项目:Hotel-Properties-Management-System 作者:
public List<Payment> getAllPaymentsForToday(String today) {
    List<Payment> paymentsList = null;
    try {

        session = dataSourceFactory.getSessionFactory().openSession();
        beginTransactionIfAllowed(session);
        Query<Payment> query = session.createQuery("from Payment where dateTime >= :today", Payment.class);
        query.setParameter("today", today);
        paymentsList = query.getResultList();

        logging.setMessage("PaymentDaoImpl -> fetching all payments for today...");

    } catch (NoResultException e) {
        logging.setMessage("PaymentDaoImpl Error ->" + e.getLocalizedMessage());
    } finally {
        session.close();
    }
    return paymentsList;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号