/*
* JBoss, Home of Professional Open Source
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
//$Id: Employee.java,v 1.5.2.5 2005/09/27 01:49:19 starksm Exp $
package org.jboss.ejb3.test.joininheritance;

import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * @author Gavin King
 */
@Entity
@Table(name="EMPLOYEE_TABLE")
@Inheritance(strategy = InheritanceType.JOINED)
public class Employee extends Person
{
   private String title;
   private BigDecimal salary;
   private Employee manager;

   /**
    * @return Returns the title.
    */
   public String getTitle()
   {
      return title;
   }

   /**
    * @param title The title to set.
    */
   public void setTitle(String title)
   {
      this.title = title;
   }

   @OneToOne
   @JoinColumn(name = "manager")
   public Employee getManager()
   {
      return manager;
   }

   /**
    * @param manager The manager to set.
    */
   public void setManager(Employee manager)
   {
      this.manager = manager;
   }

   /**
    * @return Returns the salary.
    */
   public BigDecimal getSalary()
   {
      return salary;
   }

   /**
    * @param salary The salary to set.
    */
   public void setSalary(BigDecimal salary)
   {
      this.salary = salary;
   }
}
