grails « Association « JPA Q&A

1. setting up associations directly through ids in grails

I have 2 domain objects with a one-to-many relationship. Just as an example:

Class Author{
  static hasMany = [posts: Post]
Class Post{
  Author author
In the database the post table has a ...

2. Grails GORM/HQL - retreive data from association

I have a Blog domain class, which has many messages:

class Blog {

    String description

    static hasMany = [messages : Message]
    static belongsTo ...

3. Grails Domain Create Association Table

I have a question about creating an associative table, in grails, to reconcile a many-to-many relationship. The setup is this: 1. Domain A (Client Profile) can have many Domain B ...

4. Grails replace object in one-to-one association

I have two following domains:

User {
   UserData userData

UserData {
   static belongsTo = [user: User]
and at some point I want to merge two users into one. I mean ...