Hi,
let's go straight to the problems (with Grails 1.1.1, it should work on previous one)
I have 2 domains ie: User and Detail like this :
Class User {
String userName ;
..... // another fields
static hasMany = [details:Detail];
}
Class Detail{
String detailName ;
... // another fields
static belongsTo = [user:User];
}
Now if I did :
def user = User.get(1);
Detail.findAllByUser(user);
why it produce error ?
But if i do modification on Detail
Class Detail{
String detailName ;
... // another fields
User user;
static belongsTo = [user:User];
}
(by adding user) it will work like normal ...
is there any effect using belongsTo ? or i did mistakes concept in here?