“@EMBEDDDID” Kode Jawaban

@EMBEDDDID

@Embeddable
public class BookId implements Serializable {

    private String author;
    private String name;

    // standard getters and setters
}
Prickly Peafowl

@EMBEDDDID

@Entity
public class Book {

    @EmbeddedId
    private BookId id;
    private String genre;
    private Integer price;

    //standard getters and setters
}
Prickly Peafowl

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya