package cane.brothers.circus.domain;

import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.joda.time.DateTime;

public class Performance extends BaseEntity {
	
	/**
	 * время и дата начала сеанса
	 */
	private DateTime logOnTime;
	
	/**
	 * код представления
	 */
	@ManyToOne(fetch=FetchType.LAZY, optional = false)
	@JoinColumn(name="program_id", unique = true, nullable = false)	
	private Program program; 

	private PerformanceState state;

	public Performance() {
	}

	public Performance(DateTime logOnTime, Program program) {
		this.logOnTime = logOnTime;
		this.program = program;
	}

	public Performance(DateTime logOnTime, Program program, PerformanceState state) {
		this.logOnTime = logOnTime;
		this.program = program;
		this.state = state;
	}

	public DateTime getLogOnTime() {
		return logOnTime;
	}

	public void setLogOnTime(DateTime logOnTime) {
		this.logOnTime = logOnTime;
	}

	public Program getProgram() {
		return program;
	}

	public void setProgram(Program program) {
		this.program = program;
	}

	public PerformanceState getState() {
		return state;
	}

	public void setState(PerformanceState state) {
		this.state = state;
	}
	
	
}

@@ -29,24 +29,96 @@
 .domain;%0D%0A%0D%0A
+import javax.persistence.Column;%0D%0Aimport javax.persistence.Enumerated;%0D%0A
 import javax
@@ -565,16 +565,59 @@
 am; %0D%0A%0D%0A
+%09%0D%0A%09@Column(name = %22STATE%22)%0D%0A%09@Enumerated%0D%0A
 %09private

add enumerated