I am new to Grails and GORM, and I am trying to implement a One-to-Many relationship. I tried the example in the document:
class Book {
String title
}
class Author {
static hasMany = [books: Book]
String name
}
Here are the generated tables:
AUTHOR
- Id (PK)
- Name
BOOK
- Id (PK)
- Title
AUTHOR_BOOK
- Author_Books_Id
- Book_Id
I was expecting something more:
AUTHOR
- Id (PK)
- Name
BOOK
- Author_Id (PK)
- Book_Index (PK)
- Title
Is there any way to achieve this (get rid of the connection table)?
Yann source
share