hql可以使用更新语句,但是不能使用insert。可以使用本地sql实现。 String sql = "INSERT INTO gg_department VALUES(?, ?)"; Query query = session.createSQLQuery(sql);