Last active
June 22, 2020 20:58
-
-
Save dnlcorrea/d98fa2e630e4d7795daf5499bcad9770 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.persistence.*; | |
import java.util.List; | |
@Entity | |
@Table(name = "books") | |
public class Book { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
private Long id; | |
private String name; | |
private String isbn; | |
@ManyToMany(mappedBy = "books", fetch = FetchType.LAZY) | |
private List<Author> authors; | |
// Getters / Setters... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment