package com.javahonk.bean;

// Generated May 21, 2014 7:25:48 PM by Hibernate Tools 3.4.0.CR1

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * Person generated by hbm2java
 */
@Entity
@Table(name = "person", catalog = "javahonk")
public class Person implements java.io.Serializable {

    private Integer id;
    private Address address;
    private String firstName;
    private String lastName;

    public Person() {
    }

    public Person(Address address) {
	this.address = address;
    }

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

    @GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "address"))
    @Id
    @GeneratedValue(generator = "generator")
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
	return this.id;
    }

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

    @OneToOne(fetch = FetchType.LAZY)
    @PrimaryKeyJoinColumn
    public Address getAddress() {
	return this.address;
    }

    public void setAddress(Address address) {
	this.address = address;
    }

    @Column(name = "First_Name", length = 50)
    public String getFirstName() {
	return this.firstName;
    }

    public void setFirstName(String firstName) {
	this.firstName = firstName;
    }

    @Column(name = "Last_Name", length = 50)
    public String getLastName() {
	return this.lastName;
    }

    public void setLastName(String lastName) {
	this.lastName = lastName;
    }

}
