1.

How You Can Create A Bidirectional Relationships In Gorm?

Answer»

using:

static belongsTo = USER

EXAMPLE:

CLASS User {
static hasMany = [ARTICLES: Article]
}
class Article {
static belongsTo = User
}

using:

static belongsTo = User

example:

class User {
static hasMany = [articles: Article]
}
class Article {
static belongsTo = User
}



Discussion

No Comment Found