Before mapping the entities to the database, you must add the necessary fields to each entity.
Add the following fields to the Employee entity:
private Long id; private String firstNname; private String lastName; private String address; private List<PhoneNumber> phoneNumbers; private Long version;
Import java.util.List.
Generate Getters and Setters for each field.
Add the following fields to the Address entity:
private Long id; private String street; private String city; private String stateOrProvince; private String country; private String postalCode;
Add the following fields to the PhoneNumber entity:
private String type; private String areaCode; private String number; private Employee owner;
Next, you will Associate the entity with a database table.