Test.java.svn-base 1.12 KB
Newer Older
Kim Gyeongeun committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
package jp.agentec.sinaburocast.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.apache.commons.lang.builder.StandardToStringStyle;
import org.apache.commons.lang.builder.ToStringBuilder;

@Entity
@Table(name="t_test")
public class Test extends AbstractEntity {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "test_id")
	public Integer testId;

	@Column(name = "test_name")
	public String testName;

	@Column(name = "test_type_id")
	public Integer testTypeId;
	
	@Column(name = "parent_test_id")
	public Integer parentTestId;

	
    @ManyToOne
    @JoinColumn(name = "test_type_id", referencedColumnName = "test_type_id")
	public TestType testType;

	@OneToMany(mappedBy="parent")
	public List<Test> childList;

	@ManyToOne
	public Test parent;

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, StandardToStringStyle.SIMPLE_STYLE).toString();
	}

}