001package ball.tv.epg.entity; 002/*- 003 * ########################################################################## 004 * TV H/W, EPGs, and Recording 005 * $Id: Channel.java 5285 2020-02-05 04:23:21Z ball $ 006 * $HeadURL: svn+ssh://svn.hcf.dev/var/spool/scm/repository.svn/ball-tv/trunk/src/main/java/ball/tv/epg/entity/Channel.java $ 007 * %% 008 * Copyright (C) 2013 - 2020 Allen D. Ball 009 * %% 010 * Licensed under the Apache License, Version 2.0 (the "License"); 011 * you may not use this file except in compliance with the License. 012 * You may obtain a copy of the License at 013 * 014 * http://www.apache.org/licenses/LICENSE-2.0 015 * 016 * Unless required by applicable law or agreed to in writing, software 017 * distributed under the License is distributed on an "AS IS" BASIS, 018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 019 * See the License for the specific language governing permissions and 020 * limitations under the License. 021 * ########################################################################## 022 */ 023import ball.databind.JSONBean; 024import java.util.Date; 025import javax.persistence.Column; 026import javax.persistence.Entity; 027import javax.persistence.Id; 028import javax.persistence.IdClass; 029import javax.persistence.Table; 030import lombok.EqualsAndHashCode; 031import lombok.Getter; 032import lombok.NoArgsConstructor; 033import lombok.Setter; 034 035import static javax.persistence.AccessType.PROPERTY; 036 037/** 038 * {@link Channel} {@link Entity}. 039 * 040 * {@bean.info} 041 * 042 * @author {@link.uri mailto:ball@hcf.dev Allen D. Ball} 043 * @version $Revision: 5285 $ 044 */ 045@Entity 046@Table(catalog = "epg", name = "channels") 047@IdClass(Channel.PK.class) 048@NoArgsConstructor @EqualsAndHashCode(callSuper = false) 049public class Channel extends JSONBean { 050 private static final long serialVersionUID = -5191844649885544955L; 051 052 /** @serial */ 053 @Id @Column(length = 32, nullable = false) 054 @Getter @Setter 055 private String lineup = null; 056 057 /** @serial */ 058 @Id @Column(length = 8, nullable = false) 059 @Getter @Setter 060 private String channel = null; 061 062 /** @serial */ 063 @Column(nullable = false) 064 @Getter @Setter 065 private int stationID = -1; 066 067 public String getDTYPE() { return getClass().getSimpleName(); } 068 069 @NoArgsConstructor @EqualsAndHashCode(callSuper = false) 070 public static class PK extends JSONBean { 071 private static final long serialVersionUID = -4065587648696882908L; 072 073 /** @serial */ @Getter @Setter private String lineup = null; 074 /** @serial */ @Getter @Setter private String channel = null; 075 } 076}