content: package net.alanbinu.springboot.entity;
  
  import javax.persistence.CascadeType;
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.FetchType;
  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 = "users")
  public class User {
  	
  	@Id
  	@GeneratedValue(strategy = GenerationType.IDENTITY)
  	private long id;
  	
  	@Column(name = "name")
  	private String name;
  	
  	@Column(name = "email")
  	private String email;
  	
  	@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
  	@JoinColumn(name = "up_id")
  	private UserProfile userProfile;
  	
  	public User() {
  		
  	}
  	
  	public User(String name, String email, UserProfile userProfile) {
  		super();
  		this.name = name;
  		this.email = email;
  		this.userProfile = userProfile;
  	}
  	
  	public long getId() {
  		return id;
  	}
  	public void setId(long id) {
  		this.id = id;
  	}
  	public String getName() {
  		return name;
  	}
  	public void setName(String name) {
  		this.name = name;
  	}
  	public String getEmail() {
  		return email;
  	}
  	public void setEmail(String email) {
  		this.email = email;
  	}
  	public UserProfile getUserProfile() {
  		return userProfile;
  	}
  	public void setUserProfile(UserProfile userProfile) {
  		this.userProfile = userProfile;
  	}
  }
  