package com.peetz.medien.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@NamedQueries({
    @NamedQuery(name="Film.findAll", query="SELECT f from FilmEntity as f"),
    @NamedQuery(name="Film.findByTitle", query="SELECT f from FilmEntity as f WHERE f.title = :title")
})

@Entity
@Table(name="FILM")
public class FilmEntity
{
	private Long id;
	private String title;
	private BoxSetEntity boxSet;
	
	@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;
	}

	@ManyToOne
	public BoxSetEntity getBoxSet() {
		return boxSet;
	}

	public void setBoxSet(BoxSetEntity boxSet) {
		this.boxSet = boxSet;
	}
}
