直接上代码啦。。// hibernate save 后得到主键 applySettleDao.save(applySettle);
apsId=applySettle.getApsId(); // 另有将date类型时间转化为Timestamp类型new Timestamp(CalendarUtils.getParseDate("yyyy-MM-dd", vo.getReceDate()).getTime())
本文介绍如何在使用Hibernate框架保存对象后获取其主键,并演示了如何将Date类型的时间转换为Timestamp类型,适用于数据库操作及时间处理场景。
直接上代码啦。。// hibernate save 后得到主键 applySettleDao.save(applySettle);
apsId=applySettle.getApsId(); // 另有将date类型时间转化为Timestamp类型new Timestamp(CalendarUtils.getParseDate("yyyy-MM-dd", vo.getReceDate()).getTime())
2914
5232

被折叠的 条评论
为什么被折叠?