Hi,
I have Account domain that may have relationship with another Account.
But the Account may stand alone as well (means has no relationship)
I defined it like this :
class Account{
String info ;
.....
static hasMany = [relatedAccount:Account] ;
}
in some case, I need to create 2 account on the same time :
def firstAccount = new Account() ;
....
def secondAccount = new Account();
...
firstAccount and secondAccount are related.
my question.
1. is this correct one to save the relationship between 2 new account ?
firstAccount.addToRelatedAccount(secondAccount);
secondAccount.addToRelatedAccount(firstAccount);
firstAccount.save(flush:true);
secondAccount.save(flush:true);
2. how to delete both accounts without creating an exception ?
thank you ...
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email