2 * Copyright 2006 the original author or authors.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.wamblee.mythtv;
19 import java.io.Serializable;
20 import java.util.Date;
22 import javax.persistence.Column;
23 import javax.persistence.EmbeddedId;
24 import javax.persistence.Entity;
25 import javax.persistence.Id;
26 import javax.persistence.IdClass;
27 import javax.persistence.JoinColumn;
28 import javax.persistence.JoinColumns;
29 import javax.persistence.ManyToOne;
30 import javax.persistence.Table;
31 import javax.persistence.Temporal;
32 import javax.persistence.TemporalType;
33 import javax.persistence.Transient;
38 * @author Erik Brakkee
41 @Table(name="recorded")
42 public class Recording implements Serializable {
44 private RecordingPk _id;
46 private String _basename;
48 private Date _progstart;
50 private String _title;
52 private String _subtitle;
54 private long _filesize;
56 protected Recording() {
64 public RecordingPk getId() {
69 * @param aId the id to set
71 public void setId(RecordingPk aId) {
76 * @return the basename
78 @Column(name="basename")
79 public String getBasename() {
84 * @param aBasename the basename to set
86 public void setBasename(String aBasename) {
87 _basename = aBasename;
91 * @return the progstart
93 @Column(name="progstart")
94 @Temporal(TemporalType.TIMESTAMP)
95 public Date getProgstart() {
100 * @param aProgstart the progstart to set
102 public void setProgstart(Date aProgstart) {
103 _progstart = aProgstart;
107 public Channel getChannel() {
108 return _id.getChannel();
112 public Date getStarttime() {
113 return _id.getStartTime();
119 @Column(name="title")
120 public String getTitle() {
125 * @param aTitle the title to set
127 public void setTitle(String aTitle) {
132 * @return the subtitle
134 @Column(name="subtitle")
135 public String getSubtitle() {
140 * @param aSubtitle the subtitle to set
142 public void setSubtitle(String aSubtitle) {
143 _subtitle = aSubtitle;
147 * @return the filesize
149 @Column(name="filesize")
150 public long getFilesize() {
154 public void setFilesize(long aFilesize) {
155 _filesize = aFilesize;
159 * @see java.lang.Object#toString()
162 public String toString() {
163 return "Recording(" + _id + "," + _basename + "," + _progstart + "," + _title + "," + _subtitle + ")";
167 * @see java.lang.Object#equals(java.lang.Object)
170 public boolean equals(Object aObj) {
171 if ( !(aObj instanceof Recording)) {
174 Recording recording = (Recording)aObj;
175 return _id.equals(recording._id);
179 * @see java.lang.Object#hashCode()
182 public int hashCode() {
183 return _id.hashCode();