Java 如何在HQL中获取已删除的行数
我正在HQL中删除:Java 如何在HQL中获取已删除的行数,java,hibernate,hql,Java,Hibernate,Hql,我正在HQL中删除: String queryText = DELETE FROM Books WHERE author = 'author1' final Query query = getCurrentSession().createQuery(queryText); query.executeUpdate(); 如何获取查询中已删除的行数?方法executeUpdate返回已删除的实体数 因此,您将通过以下代码获得删除的行数n: int n = query.executeUpdat
String queryText = DELETE FROM Books WHERE author = 'author1'
final Query query = getCurrentSession().createQuery(queryText);
query.executeUpdate();
如何获取查询中已删除的行数?方法executeUpdate返回已删除的实体数
因此,您将通过以下代码获得删除的行数n:
int n = query.executeUpdate();
方法executeUpdate返回已删除的实体数
因此,您将通过以下代码获得删除的行数n:
int n = query.executeUpdate();
preparedStatement.executeUpdate返回受影响的行数
例如:
int row =preparedStatement.executeUpdate();
preparedStatement.executeUpdate返回受影响的行数
例如:
int row =preparedStatement.executeUpdate();