/*
 *  The MIT License (MIT)
 *
 *  Copyright (c) 2015 Joseph Hendrix
 *
 *  Permission is hereby granted, free of charge, to any person obtaining a copy
 *  of this software and associated documentation files (the "Software"), to deal
 *  in the Software without restriction, including without limitation the rights
 *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  copies of the Software, and to permit persons to whom the Software is
 *  furnished to do so, subject to the following conditions:
 *
 *  The above copyright notice and this permission notice shall be included in all
 *  copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 *  SOFTWARE.
 *
 *  Hosted on GitHub at https://github.com/hendrixjoseph/FamilyTree
 *
 */
package edu.wright.hendrix11.familyTree.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author Joe Hendrix <hendrix.11@wright.edu>
 */
@Entity
@Table(name = "PERSON")
public class Person
{
    @Id
    private int id;

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public Gender getGender()
    {
        return gender;
    }

    public void setGender(Gender gender)
    {
        this.gender = gender;
    }

    private String name;

    @ManyToOne
    @JoinColumn(name="GENDER")
    private Gender gender;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinTable(name="FATHER_OF",
        joinColumns=@JoinColumn(name="CHILD_ID"),
        inverseJoinColumns=@JoinColumn(name="FATHER_ID"))
    private PersonView father;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinTable(name="MOTHER_OF",
            joinColumns=@JoinColumn(name="CHILD_ID"),
            inverseJoinColumns=@JoinColumn(name="MOTHER_ID"))
    private PersonView mother;

    public int getId()
    {
        return id;
    }

    public void setId(int id)
    {
        this.id = id;
    }

    public PersonView getFather()
    {
        return father;
    }

    public void setFather(PersonView father)
    {
        this.father = father;
    }

    public PersonView getMother()
    {
        return mother;
    }

    public void setMother(PersonView mother)
    {
        this.mother = mother;
    }


}

@@ -2243,28 +2243,24 @@
 ivate Person
-View
  father;%0A%0A  
@@ -2252,24 +2252,24 @@
 son father;%0A
+
 %0A    @ManyTo
@@ -2459,28 +2459,24 @@
 ivate Person
-View
  mother;%0A%0A  
@@ -2606,28 +2606,24 @@
 ublic Person
-View
  getFather()
@@ -2691,20 +2691,16 @@
 r(Person
-View
  father)
@@ -2760,20 +2760,16 @@
 c Person
-View
  getMoth
@@ -2845,12 +2845,8 @@
 rson
-View
  mot
@@ -2890,14 +2890,12 @@
 er;%0A
+
     %7D%0A
-%0A%0A
 %7D%0A

Update Person.java