All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adaptrex.sandbox.entities.jpa.Theater Maven / Gradle / Ivy

The newest version!
package com.adaptrex.sandbox.entities.jpa;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@SuppressWarnings("serial")
@Entity
@Table(name = "theater")
public class Theater implements Serializable {

	@Id
	@Column(name = "id")
	@GeneratedValue
	private int		id;

	@Column(name = "name")
	private String	name;

	@Column
	private Float longitude;
	
	@Column
	private Float latitude;
	
	@Column(name = "opening_time")
	@Temporal(TemporalType.TIME)
	private Date openingTime;

	@Column(name = "closing_time")
	@Temporal(TemporalType.TIME)
	private Date closingTime;	
	
	@ManyToMany
	@JoinTable(
	     name="theater_has_movie",
	     joinColumns={@JoinColumn(name="theater_id", referencedColumnName="id")},
	     inverseJoinColumns={@JoinColumn(name="movie_id", referencedColumnName="id")})
	private List movies;
	
	/*
	 * Getters
	 */
	public Integer getId() {
		return id;
	}
	public String getName() {
		return name;
	}
	
	public Date getOpeningTime() {
		return openingTime;
	}
	
	public Date getClosingTime() {
		return closingTime;
	}
	
	public Float getLatitude() {
		return latitude;
	}
	
	public Float getLongitude() {
		return longitude;
	}
	
	public List getMovies() {
		return movies;
	}
	
	
	/*
	 * Setters
	 */
	public void setName(String name) {
		this.name = name;
	}

	public void setOpeningTime(Date date) {
		this.openingTime = date;
	}

	public void setClosingTime(Date date) {
		this.closingTime = date;
	}
	
	public void setLatitude(Float latitude) {
		this.latitude = latitude;
	}
	
	public void setLongitude(Float longitude) {
		this.longitude = longitude;
	}
	
	public void setMovies(List movies) {
		this.movies = movies;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy