package com.revature.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="ie_person")
public class Person {

	@Id
	@Column(name = "p_id")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="perSeq")
	@SequenceGenerator(allocationSize=1, name="perSeq", sequenceName="person_seq")
	private int id;

	@Column(name = "p_firstname", nullable = false)
	private String firstName;
	
	@Column(name = "p_lastname", nullable = false)
	private String lastName;
	
	public Person() {}

	public Person(String firstName, String lastName) {
		super();
		this.firstName = firstName;
		this.lastName = lastName;
	}

	@Override
	public String toString() {
		return "Person [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + "]";
	}

	public int getId() {
		return id;
	}

	public void setId(int 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;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
		result = prime * result + id;
		result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Person other = (Person) obj;
		if (firstName == null) {
			if (other.firstName != null)
				return false;
		} else if (!firstName.equals(other.firstName))
			return false;
		if (id != other.id)
			return false;
		if (lastName == null) {
			if (other.lastName != null)
				return false;
		} else if (!lastName.equals(other.lastName))
			return false;
		return true;
	}

	
		
}

@@ -685,16 +685,87 @@
 Name;%0A%09%0A
+%09@Column(name = %22p_role%22, nullable = false)%0A%09private int personRole;%0A%09%0A
 %09public 
@@ -821,24 +821,40 @@
 ing lastName
+, int personRole
 ) %7B%0A%09%09super(
@@ -906,32 +906,64 @@
 ame = lastName;%0A
+%09%09this.personRole = personRole;%0A
 %09%7D%0A%0A%09@Override%0A%09
@@ -1074,16 +1074,47 @@
 stName +
+ %22, personRole=%22 + personRole +
  %22%5D%22;%0A%09%7D
@@ -1463,24 +1463,162 @@
 lastName;%0A%09%7D
+%0A%09%0A%09public int getPersonRole() %7B%0A%09%09return personRole;%0A%09%7D%0A%09%0A%09public void setPersonRole(int personRole) %7B%0A%09%09this.personRole = personRole;%0A%09%7D
 %0A%0A%09@Override
@@ -1867,24 +1867,64 @@
 ashCode());%0A
+%09%09result = prime * result + personRole;%0A
 %09%09return res
@@ -2456,16 +2456,71 @@
  false;%0A
+%09%09if (personRole != other.personRole)%0A%09%09%09return false;%0A
 %09%09return

update Person class with new personRole field, getters, setters, hash, equals overwrite, and toString method