Suppose I have two domain models Author and Book. So Author can have one or many books.
From the documentation for Siena, it seems to suggest something like:
public class Author extends Model {
@Id
public Long id;
public String name;
public Book book;
}
But I was expecting something like:
public class Author extends Model {
@Id
public Long id;
public String name;
public List<Books> books = new ArrayList<Book>();
}
So in my code I can do something like:
Book book1 = new Book(), boo2 = new Book();
Author author = new Author(); author.books.add(book1); author.books.add(book2); author.insert();
But this does not seem right from the documentation Siena
The question is what is the correct solution?