int batNumIdCount = this.getJdbcTemplate().queryForInt(sqlI.toString());
查询:
当确定返回的实例只有一个或者null时 用list()方法
this.getSession().createSQLQuery(sql.toString()).list();
当确定返回的实例只有一个或者null时 用uniqueResult()方法
this.getSession().createSQLQuery(sql.toString()).uniqueResult()
查询
this.getSession().createSQLQuery(sql.toString()).list();
hibernate增加,更新
this.getSession().createSQLQuery(sql.toString()).executeUpdate(); SQL
this.getSession().createQuery(sql.toString()).executeUpdate(); HQL
jdbc增加 更新
this.getJdbcTemplate().execute(sql.toString());
this.getJdbcTemplate().update(sql.toString());
批量更新
this.getJdbcTemplate().batchUpdate(sql.split(";\n"));