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;
33 * @author Erik Brakkee
36 public class RecordingPk implements Serializable {
37 public Channel _channel;
38 public Date _starttime;
40 public RecordingPk() {
48 @JoinColumn(name="chanid")
49 public Channel getChannel() {
54 * @param aChannel the channel to set
56 public void setChannel(Channel aChannel) {
61 * @return the starttime
63 @Column(name="starttime")
64 @Temporal(TemporalType.TIMESTAMP)
65 public Date getStartTime() {
70 * @param aStarttime the starttime to set
72 public void setStartTime(Date aStarttime) {
73 _starttime = aStarttime;
77 * @see java.lang.Object#equals(java.lang.Object)
80 public boolean equals(Object aObj) {
84 if ( !(aObj instanceof RecordingPk)) {
87 RecordingPk pk = (RecordingPk) aObj;
88 return _channel.equals(pk._channel) && _starttime.equals(pk._starttime);
92 * @see java.lang.Object#hashCode()
95 public int hashCode() {
96 return _channel.hashCode() + _starttime.hashCode();
100 * @see java.lang.Object#toString()
103 public String toString() {
104 return "pk(" + _channel + ", " + _starttime + ")";