gorm批量删除

2015-12-14 0 349
gorm批量删除
def batchDelete(Class entityClass,ids){
entityClass.executeUpdate("delete ${entityClass.name} where id in(:ids)",[ids:ids*.toLong()])
//还需清除sessionFactory缓存中数据
            entityClass.withSession{ session ->
                ids.each{ id ->
                    session.sessionFactory.evict(entityClass,id)
                }
            }
}

遇见资源网 groovy gorm批量删除 http://www.ox520.com/13765.html

上一篇:

已经没有上一篇了!

下一篇:

已经没有下一篇了!

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务