【发布时间】:2018-02-27 05:40:40
【问题描述】:
Query branch_update = null;
Branches branchObject = null;
try {
branch_update = this.sessionFactory.getCurrentSession()
.createQuery("Update Branches set branchname =:branchname,update_date =:update_date WHERE branchname =:branchname1");
branch_update.setParameter("branchname", stringCellValue);
branch_update.setParameter("update_date", new Date());
branch_update.setParameter("branchname1", stringCellValue);
int update_id = branch_update.executeUpdate();
} catch (Exception exception) {
logger.error("Exception occured at \t e", exception.getMessage(), exception);
}
同时使用分支名称更新行。如何获取更新的行 branch_id ?
提前谢谢...
【问题讨论】:
-
您是否使用 auto_increment 作为 branch_id?
标签: java mysql sql mongodb hibernate