logo

Crowdly

Browser

Додати до Chrome

@Entity(name = "Contact") public static class Contact { @Id private...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

@Entity(name = "Contact")

public static class Contact {

@Id

private Integer id;

private Name name;

private String notes;

private URL website;

private boolean starred;

//Getters and setters are omitted for brevity

}

@Embeddable

public class Name {

private String firstName;

private String middleName;

private String lastName;

// getters and setters omitted

}

Entities, by nature of their unique identifier, exist independently of other objects whereas values do not. Entities are domain model classes which correlate to rows in a database table, using a unique identifier. Because of the requirement for a unique identifier, entities exist independently and define their own lifecycle. The Contact class itself would be an example of an entity.

0%
0%
Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на elearning.tgm.ac.at?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome