session.createSQLQuery(sql).executeUpdate()
时间: 2024-05-24 22:12:56 浏览: 84
update.sql
This line of code creates a SQL query using the specified SQL string and executes it, which returns the number of entities (rows) affected by the query. The method executeUpdate() is used to execute the query and update the database. The result is not returned as a list or object but as an integer representing the count of rows affected. This method is typically used for executing INSERT, UPDATE, DELETE statements.
阅读全文