package com.peetz.medien.entity;

import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="BOXSET")
public class BoxSetEntity
{
	private Long id;
	private String title;
	private Collection<FilmEntity> films;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Long getId() { return id; }
	
	@SuppressWarnings("unused")
	private void setId(Long id) { this.id = id; }

	@Column
	public String getTitle() { return title; }

	public void setTitle(String title) { this.title = title; }

	@OneToMany(mappedBy="boxSet", cascade=CascadeType.REMOVE)
	public Collection<FilmEntity> getFilms() {
		return films;
	}

	public void setFilms(Collection<FilmEntity> films) {
		this.films = films;
	}

}
