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.Entity;
24 import javax.persistence.Id;
25 import javax.persistence.IdClass;
26 import javax.persistence.JoinColumn;
27 import javax.persistence.JoinColumns;
28 import javax.persistence.ManyToOne;
29 import javax.persistence.Table;
35 @Table(name="recorded")
36 //@IdClass(RecordingPk.class)
37 public class Recording implements Serializable {
40 @ManyToOne(targetEntity=Channel.class)
41 @JoinColumn(name="chanid")
42 private Channel _channel;
44 @Column(name="starttime")
45 private Date _starttime;
47 @Column(name="basename")
48 private String _basename;
50 @Column(name="progstart")
51 private Date _progstart;
54 private String _title;
56 @Column(name="subtitle")
57 private String _subtitle;
59 @Column(name="filesize")
60 private long _filesize;
62 protected Recording() {
69 public Channel getChannel() {
74 * @return the basename
76 public String getBasename() {
81 * @return the progstart
83 public Date getStartTime() {
88 * @return the progstart
90 public Date getProgstart() {
97 public String getTitle() {
102 * @return the subtitle
104 public String getSubtitle() {
109 * @return the filesize
111 public long getFilesize() {
115 public void setFilesize(long aFilesize) {
116 _filesize = aFilesize;
120 * @see java.lang.Object#toString()
123 public String toString() {
124 return "Recording(" + _channel + "," + _basename + "," + _progstart + "," + _title + "," + _subtitle + ")";
128 * @see java.lang.Object#equals(java.lang.Object)
131 public boolean equals(Object aObj) {
132 if ( !(aObj instanceof Recording)) {
135 Recording recording = (Recording)aObj;
136 return _channel.equals(recording._channel) && _starttime.equals(recording._starttime);
140 * @see java.lang.Object#hashCode()
143 public int hashCode() {
144 return _channel.hashCode()*10 + ((int)_starttime.getTime() %10);