content: package net.alanbinu.springboot.jpa.model;
  
  import javax.persistence.CascadeType;
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.Id;
  import javax.persistence.JoinColumn;
  import javax.persistence.OneToOne;
  import javax.persistence.Table;
  
  @Entity
  @Table(name="instructor")
  public class Instructor {
  
  	@Id
  	@GeneratedValue(strategy=GenerationType.IDENTITY)
  	@Column(name="id")
  	private Long id;
  	
  	@Column(name="first_name")
  	private String firstName;
  	
  	@Column(name="last_name")
  	private String lastName;
  
  	@Column(name="email")
  	private String email;
  	
  	@OneToOne(cascade=CascadeType.ALL)
  	@JoinColumn(name="instructor_detail_id")
  	private InstructorDetail instructorDetail;
  	
  	public Instructor() {
  		
  	}
  
  	public Instructor(String firstName, String lastName, String email) {
  		this.firstName = firstName;
  		this.lastName = lastName;
  		this.email = email;
  	}
  
  	public Long getId() {
  		return id;
  	}
  
  	public void setId(Long id) {
  		this.id = id;
  	}
  
  	public String getFirstName() {
  		return firstName;
  	}
  
  	public void setFirstName(String firstName) {
  		this.firstName = firstName;
  	}
  
  	public String getLastName() {
  		return lastName;
  	}
  
  	public void setLastName(String lastName) {
  		this.lastName = lastName;
  	}
  
  	public String getEmail() {
  		return email;
  	}
  
  	public void setEmail(String email) {
  		this.email = email;
  	}
  
  	public InstructorDetail getInstructorDetail() {
  		return instructorDetail;
  	}
  
  	public void setInstructorDetail(InstructorDetail instructorDetail) {
  		this.instructorDetail = instructorDetail;
  	}
  
  	@Override
  	public String toString() {
  		return "Instructor [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", email=" + email
  				+ ", instructorDetail=" + instructorDetail + "]";
  	}
  	
  	
  }
  
  
  
  
  
  
  