0

I have 3 classes as per below...

Class A
{
      E objE;
}

Class B
{
   E objE;
}


Class E 
{
   E objE;
   belongsTo:[
               a : A,
               b : B
             ]
   static constraints = {
        a nullable: true
        b nullable: true
        c nullable: true
   }
}

When I am trying to save object of A class it through exception for null.

Ashish Jani
  • 295
  • 3
  • 14

1 Answers1

0

Try to remove the hasOne on Class Incidents, Problems, Requests and replace it with

 E eObj
   static constraints = {eObj: unique: true, nullable:true}       
   static mapping = {
    eObj cascade: "delete"
    }
sanghavi7
  • 758
  • 1
  • 15
  • 38