“@embededid” Code-Antworten

@embededid

@Embeddable
public class BookId implements Serializable {

    private String author;
    private String name;

    // standard getters and setters
}
Prickly Peafowl

@embededid

@Entity
public class Book {

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

    //standard getters and setters
}
Prickly Peafowl

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen