// Path: examples/microservice/dao-api/src/main/java/org/osgi/enroute/examples/microservice/dao/dto/PersonDTO.java
// public class PersonDTO {
// 
// 	public long personId;
// 	public String firstName;
// 	public String lastName;
// 
// 	public List<AddressDTO> addresses = new ArrayList<>();
// }


import static java.util.stream.Collectors.toList;
import static javax.persistence.CascadeType.ALL;
import static javax.persistence.GenerationType.IDENTITY;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.osgi.enroute.examples.microservice.dao.dto.PersonDTO;
package org.osgi.enroute.examples.microservice.dao.impl.jpa.entities;





@Entity
@Table(name="persons")
public class PersonEntity {
    
    @GeneratedValue(strategy = IDENTITY)
    @Id
    @Column(name="person_id")
    private Long personId;
    
    @Column(name="first_name")
    private String firstName;
    
    @Column(name="last_name")
    private String lastName;

    @OneToMany(mappedBy="person", cascade=ALL)
    private List<AddressEntity> addresses = new ArrayList<>();

    public Long getPersonId() {
        return personId;
    }

// Path: examples/microservice/dao-api/src/main/java/org/osgi/enroute/examples/microservice/dao/dto/PersonDTO.java
// public class PersonDTO {
// 
// 	public long personId;
// 	public String firstName;
// 	public String lastName;
// 
// 	public List<AddressDTO> addresses = new ArrayList<>();
// }


// Path: examples/microservice/dao-impl-jpa/src/main/java/org/osgi/enroute/examples/microservice/dao/impl/jpa/entities/PersonEntity.java
import static java.util.stream.Collectors.toList;
import static javax.persistence.CascadeType.ALL;
import static javax.persistence.GenerationType.IDENTITY;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.osgi.enroute.examples.microservice.dao.dto.PersonDTO;

package org.osgi.enroute.examples.microservice.dao.impl.jpa.entities;





@Entity
@Table(name="persons")
public class PersonEntity {
    
    @GeneratedValue(strategy = IDENTITY)
    @Id
    @Column(name="person_id")
    private Long personId;
    
    @Column(name="first_name")
    private String firstName;
    
    @Column(name="last_name")
    private String lastName;

    @OneToMany(mappedBy="person", cascade=ALL)
    private List<AddressEntity> addresses = new ArrayList<>();

    public Long getPersonId() {
        return personId;
    }

    public PersonDTO toDTO() {