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;
39 @Table(name="recorded")
40 public class Recording implements Serializable {
42 private RecordingPk _id;
44 private String _basename;
46 private Date _progstart;
48 private String _title;
50 private String _subtitle;
52 private long _filesize;
54 protected Recording() {
62 public RecordingPk getId() {
67 * @param aId the id to set
69 public void setId(RecordingPk aId) {
74 * @return the basename
76 @Column(name="basename")
77 public String getBasename() {
82 * @param aBasename the basename to set
84 public void setBasename(String aBasename) {
85 _basename = aBasename;
89 * @return the progstart
91 @Column(name="progstart")
92 @Temporal(TemporalType.TIMESTAMP)
93 public Date getProgstart() {
98 * @param aProgstart the progstart to set
100 public void setProgstart(Date aProgstart) {
101 _progstart = aProgstart;
105 public Channel getChannel() {
106 return _id.getChannel();
110 public Date getStarttime() {
111 return _id.getStartTime();
117 @Column(name="title")
118 public String getTitle() {
123 * @param aTitle the title to set
125 public void setTitle(String aTitle) {
130 * @return the subtitle
132 @Column(name="subtitle")
133 public String getSubtitle() {
138 * @param aSubtitle the subtitle to set
140 public void setSubtitle(String aSubtitle) {
141 _subtitle = aSubtitle;
145 * @return the filesize
147 @Column(name="filesize")
148 public long getFilesize() {
152 public void setFilesize(long aFilesize) {
153 _filesize = aFilesize;
157 * @see java.lang.Object#toString()
160 public String toString() {
161 return "Recording(" + _id + "," + _basename + "," + _progstart + "," + _title + "," + _subtitle + ")";
165 * @see java.lang.Object#equals(java.lang.Object)
168 public boolean equals(Object aObj) {
169 if ( !(aObj instanceof Recording)) {
172 Recording recording = (Recording)aObj;
173 return _id.equals(recording._id);
177 * @see java.lang.Object#hashCode()
180 public int hashCode() {
181 return _id.hashCode();