Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alejandro-loza/7b1b7b4ef920fde645dd to your computer and use it in GitHub Desktop.
Save alejandro-loza/7b1b7b4ef920fde645dd to your computer and use it in GitHub Desktop.
cascade delete
void rollback(List<ItemGroupProfile> itemGroupProfiles){
itemGroupProfiles.each { itemGroupProfile ->
SkuProfile.executeUpdate(
'delete from SkuProfile where itemGroupProfile=:itemGroupProfile',
[itemGroupProfile: itemGroupProfile])
itemGroupProfile.delete(flush: true, failOnError: true)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment