“@EMBEDDEDID” Réponses codées

@EMBEDDEDID

@Embeddable
public class BookId implements Serializable {

    private String author;
    private String name;

    // standard getters and setters
}
Prickly Peafowl

@EMBEDDEDID

@Entity
public class Book {

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

    //standard getters and setters
}
Prickly Peafowl

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code