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.Embeddable;
24 import javax.persistence.Id;
25 import javax.persistence.JoinColumn;
26 import javax.persistence.ManyToOne;
27 import javax.persistence.Temporal;
28 import javax.persistence.TemporalType;
34 public class RecordingPk implements Serializable {
35 public Channel _channel;
36 public Date _starttime;
38 public RecordingPk() {
46 @JoinColumn(name="chanid")
47 public Channel getChannel() {
52 * @param aChannel the channel to set
54 public void setChannel(Channel aChannel) {
59 * @return the starttime
61 @Column(name="starttime")
62 @Temporal(TemporalType.TIMESTAMP)
63 public Date getStartTime() {
68 * @param aStarttime the starttime to set
70 public void setStartTime(Date aStarttime) {
71 _starttime = aStarttime;
75 * @see java.lang.Object#equals(java.lang.Object)
78 public boolean equals(Object aObj) {
82 if ( !(aObj instanceof RecordingPk)) {
85 RecordingPk pk = (RecordingPk) aObj;
86 return _channel.equals(pk._channel) && _starttime.equals(pk._starttime);
90 * @see java.lang.Object#hashCode()
93 public int hashCode() {
94 return _channel.hashCode() + _starttime.hashCode();