001package ball.game.crossword.entity;
002/*-
003 * ##########################################################################
004 * Game Applications and Utilities
005 * $Id: Header.java 5285 2020-02-05 04:23:21Z ball $
006 * $HeadURL: svn+ssh://svn.hcf.dev/var/spool/scm/repository.svn/ball-game/trunk/src/main/java/ball/game/crossword/entity/Header.java $
007 * %%
008 * Copyright (C) 2010 - 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.persistence.entity.AbstractEntity;
024import javax.persistence.Column;
025import javax.persistence.Entity;
026import javax.persistence.Id;
027import javax.persistence.IdClass;
028import javax.persistence.Lob;
029import javax.persistence.ManyToOne;
030import javax.persistence.Table;
031import lombok.EqualsAndHashCode;
032import lombok.Getter;
033import lombok.NoArgsConstructor;
034import lombok.Setter;
035import lombok.ToString;
036
037import static javax.persistence.FetchType.LAZY;
038
039/**
040 * {@link Header} {@link Entity}.
041 *
042 * {@bean.info}
043 *
044 * @author {@link.uri mailto:ball@hcf.dev Allen D. Ball}
045 * @version $Revision: 5285 $
046 */
047@Entity
048@Table(catalog = "crossword", name = "header")
049@IdClass(Header.PK.class)
050@NoArgsConstructor @EqualsAndHashCode(callSuper = false) @ToString
051public class Header extends AbstractEntity {
052    @Id @ManyToOne(fetch = LAZY)
053    @Getter @Setter
054    private Crossword crossword = null;
055
056    @Id @Column
057    @Getter @Setter
058    private String name = null;
059
060    @Column @Lob
061    @Getter @Setter
062    private String value = null;
063
064    @NoArgsConstructor @EqualsAndHashCode(callSuper = false) @ToString
065    public static class PK {
066        @Getter @Setter private Crossword crossword = null;
067        @Getter @Setter private String name = null;
068    }
069}