Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
@Entity class Book {
    @Id @GeneratedValue(strategy = GenerationType.AUTO)
    public Long id
    @OneToMany(cascade=CascadeType.ALL)
    public Set<Author> authors;
    public String title
    String toString() { "$title by ${authors.name.join(', ')}" }
}

@Entity class Author {
    @Id @GeneratedValue(strategy = GenerationType.AUTO)
    public Long id
    public String name
}

...