package com.javahonk.bean;

// Generated May 22, 2014 2:47:38 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 static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

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

	private Integer childId;
	private Mother mother;
	private String firstName;
	private String lastName;

	public Child() {
	}

	public Child(Mother mother, String firstName, String lastName) {
		this.mother = mother;
		this.firstName = firstName;
		this.lastName = lastName;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "child_id", unique = true, nullable = false)
	public Integer getChildId() {
		return this.childId;
	}

	public void setChildId(Integer childId) {
		this.childId = childId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "mother_id")
	public Mother getMother() {
		return this.mother;
	}

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

	@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;
	}

}
