Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
sess.createSQLQuery("INSERT INTO ARCHIVE (folder) VALUES(:folder)") .setParameter("folder",path) .executeUpdate();
我想要新创建的对象的 id。我怎样才能做到这一点?
尝试一下
整数 lastId = (Integer) session.createSQLQuery("SELECT LAST_INSERT_ID()") .uniqueResult();