hibernateTemplate的批量删除

public void bulkDelete(final Object[] ids) throws Exception {
        final String queryString = "delete PersistentModel where id in (:ids1) ";
        super.execute(new HibernateCallback() {
            public Object doInHibernate(Session session) throws HibernateException, SQLException {
                Query query = session.createQuery(queryString);
                query.setParameterList("ids1", ids);
                return query.executeUpdate();
            }
        });
}

你可能感兴趣的:(exception,session,object,String,delete,query)