Home Grails delete on a domain class gives me assertion failure: Unable to determine collection owner identifier for orphan-delete processing
Reply: 0

Grails delete on a domain class gives me assertion failure: Unable to determine collection owner identifier for orphan-delete processing

user1089
1#
user1089 Published in August 15, 2018, 5:37 am

Grails newbie here.

So I have an abstract domain class

abstract class Credential {

static belongsTo = [user: User]
static hasMany = [machinesCache: Machine]

static mapping = {
    /* Without this mapping delete was not propagating.
        I think this is needed because class machine belongs
        to all credentials.*/
    machinesCache cascade: "all-delete-orphan"
}
}

Then I have a BCredential domain class that extends credential class

class BCredential  extends Credential {

String name

static constraints = {
    name nullable: false, blank: false
}
}

When I try to delete an instance of the BCredential, it gives me the following error

Caused by: org.hibernate.AssertionFailure: Unable to determine collection owner identifier for orphan-delete processing

Following is the code that I use for deleting the bcredential

BCredential credential = BCredential.get(id)
credential.delete()

Any help would be appreciated

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.293541 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO