/*  This file is part of Waisda 

    Copyright (c) 2012 Netherlands Institute for Sound and Vision
    https://github.com/beeldengeluid/waisda
	
    Waisda is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Waisda is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Waisda.  If not, see <http://www.gnu.org/licenses/>.
*/

package nl.waisda.domain;_x000D_
_x000D_
import javax.persistence.Basic;_x000D_
import javax.persistence.Column;_x000D_
import javax.persistence.Entity;_x000D_
import javax.persistence.EnumType;_x000D_
import javax.persistence.Enumerated;_x000D_
import javax.persistence.GeneratedValue;_x000D_
import javax.persistence.GenerationType;_x000D_
import javax.persistence.Id;_x000D_
_x000D_
import org.hibernate.annotations.Formula;_x000D_
_x000D_
@Entity_x000D_
public class Video {_x000D_
_x000D_
	@Id_x000D_
	@GeneratedValue(strategy = GenerationType.AUTO)_x000D_
	private int id;_x000D_
_x000D_
	@Basic_x000D_
	private String title;_x000D_
_x000D_
	/** Duration in ms. */_x000D_
	@Column(nullable = false)_x000D_
	private int duration;_x000D_
_x000D_
	@Basic_x000D_
	private String imageUrl;_x000D_
_x000D_
	@Basic_x000D_
	private boolean enabled;_x000D_
_x000D_
	@Formula("(SELECT COUNT(*) FROM Game g WHERE g.video_id = id)")_x000D_
	private int timesPlayed;_x000D_
_x000D_
	@Enumerated(EnumType.STRING)_x000D_
	private PlayerType playerType;_x000D_
_x000D_
	@Basic_x000D_
	private String fragmentID;_x000D_
_x000D_
	/** Start time within episode, in ms. */_x000D_
	@Basic_x000D_
	private Integer startTime;_x000D_
_x000D_
	/** Fragmentenrubriek zoals in MBH dump. */_x000D_
	private Integer sectionNid;_x000D_
_x000D_
	private String sourceUrl;_x000D_
_x000D_
	public int getId() {_x000D_
		return id;_x000D_
	}_x000D_
_x000D_
	public String getTitle() {_x000D_
		return title;_x000D_
	}_x000D_
_x000D_
	public int getDuration() {_x000D_
		return duration;_x000D_
	}_x000D_
_x000D_
	public String getImageUrl() {_x000D_
		return imageUrl;_x000D_
	}_x000D_
_x000D_
	public boolean isEnabled() {_x000D_
		return enabled;_x000D_
	}_x000D_
_x000D_
	public int getTimesPlayed() {_x000D_
		return timesPlayed;_x000D_
	}_x000D_
_x000D_
	public PlayerType getPlayerType() {_x000D_
		return playerType;_x000D_
	}_x000D_
_x000D_
	public String getFragmentID() {_x000D_
		return fragmentID;_x000D_
	}_x000D_
_x000D_
	public Integer getStartTime() {_x000D_
		return startTime;_x000D_
	}_x000D_
_x000D_
	public Integer getSectionNid() {_x000D_
		return sectionNid;_x000D_
	}_x000D_
_x000D_
	public String getSourceUrl() {_x000D_
		return sourceUrl;_x000D_
	}_x000D_
_x000D_
	public String getPrettyDuration() {_x000D_
		return TagEntry.getFriendlyTime(duration);_x000D_
	}_x000D_
_x000D_
}
/** Fragmentenrubriek zoals in MBH dump. */
/*  This file is part of Waisda 

    Copyright (c) 2012 Netherlands Institute for Sound and Vision
    https://github.com/beeldengeluid/waisda
	
    Waisda is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Waisda is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Waisda.  If not, see <http://www.gnu.org/licenses/>.
*/

package nl.waisda.domain;_x000D_
_x000D_
import javax.persistence.Basic;_x000D_
import javax.persistence.Column;_x000D_
import javax.persistence.Entity;_x000D_
import javax.persistence.EnumType;_x000D_
import javax.persistence.Enumerated;_x000D_
import javax.persistence.GeneratedValue;_x000D_
import javax.persistence.GenerationType;_x000D_
import javax.persistence.Id;_x000D_
_x000D_
import org.hibernate.annotations.Formula;_x000D_
_x000D_
@Entity_x000D_
public class Video {_x000D_
_x000D_
	@Id_x000D_
	@GeneratedValue(strategy = GenerationType.AUTO)_x000D_
	private int id;_x000D_
_x000D_
	@Basic_x000D_
	private String title;_x000D_
_x000D_
	/** Duration in ms. */_x000D_
	@Column(nullable = false)_x000D_
	private int duration;_x000D_
_x000D_
	@Basic_x000D_
	private String imageUrl;_x000D_
_x000D_
	@Basic_x000D_
	private boolean enabled;_x000D_
_x000D_
	@Formula("(SELECT COUNT(*) FROM Game g WHERE g.video_id = id)")_x000D_
	private int timesPlayed;_x000D_
_x000D_
	@Enumerated(EnumType.STRING)_x000D_
	private PlayerType playerType;_x000D_
_x000D_
	@Basic_x000D_
	private String fragmentID;_x000D_
_x000D_
	/** Start time within episode, in ms. */_x000D_
	@Basic_x000D_
	private Integer startTime;_x000D_
_x000D_
	/** Fragmentenrubriek zoals in<SUF>*/_x000D_
	private Integer sectionNid;_x000D_
_x000D_
	private String sourceUrl;_x000D_
_x000D_
	public int getId() {_x000D_
		return id;_x000D_
	}_x000D_
_x000D_
	public String getTitle() {_x000D_
		return title;_x000D_
	}_x000D_
_x000D_
	public int getDuration() {_x000D_
		return duration;_x000D_
	}_x000D_
_x000D_
	public String getImageUrl() {_x000D_
		return imageUrl;_x000D_
	}_x000D_
_x000D_
	public boolean isEnabled() {_x000D_
		return enabled;_x000D_
	}_x000D_
_x000D_
	public int getTimesPlayed() {_x000D_
		return timesPlayed;_x000D_
	}_x000D_
_x000D_
	public PlayerType getPlayerType() {_x000D_
		return playerType;_x000D_
	}_x000D_
_x000D_
	public String getFragmentID() {_x000D_
		return fragmentID;_x000D_
	}_x000D_
_x000D_
	public Integer getStartTime() {_x000D_
		return startTime;_x000D_
	}_x000D_
_x000D_
	public Integer getSectionNid() {_x000D_
		return sectionNid;_x000D_
	}_x000D_
_x000D_
	public String getSourceUrl() {_x000D_
		return sourceUrl;_x000D_
	}_x000D_
_x000D_
	public String getPrettyDuration() {_x000D_
		return TagEntry.getFriendlyTime(duration);_x000D_
	}_x000D_
_x000D_
}