Reputation: 2389
Let's say I have an entity Book I want Jhipster to generate a Books Entity something like
class Books{
List<Book> books;
}
And Generate corresponding rest controllers like
Books saveAllBooks(Books books)
Books updateAllBooks(Books books)
Upvotes: 0
Views: 255
Reputation: 16284
There's no need to create a Books
entity if it contains only a list of Book
entities, you could just add manually the list methods to generated REST controllerBookResource.java
as you don't need any additional repository.
But if Books
has other fields that you want to persist in database, you could generate 2 entities with one-to-many relationship. I wouldn't recommend using plural as it could probably conflict with other generated code.
entity Book{
title String required
}
entity BookBatch{
name String required
}
// RELATIONSHIPS:
relationship ManyToOne {
Book to BookBatch
}
Upvotes: 1