/* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ package org.hibernate.test.join; import java.math.BigDecimal; import javax.persistence.Column; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.SecondaryTable; /** * @author Gavin King * @author Steve Ebersole */ @Entity @DiscriminatorValue( "E" ) @SecondaryTable( name = "employee" ) public class Employee extends Person { private String title; private BigDecimal salary; private Employee manager; @Column( table = "employee", name = "`title`") public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } @ManyToOne @JoinColumn( table = "employee" ) public Employee getManager() { return manager; } public void setManager(Employee manager) { this.manager = manager; } @Column( table = "employee" ) public BigDecimal getSalary() { return salary; } public void setSalary(BigDecimal salary) { this.salary = salary; } }