001package ball.game.crossword.entity; 002/*- 003 * ########################################################################## 004 * Game Applications and Utilities 005 * %% 006 * Copyright (C) 2010 - 2022 Allen D. Ball 007 * %% 008 * Licensed under the Apache License, Version 2.0 (the "License"); 009 * you may not use this file except in compliance with the License. 010 * You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, software 015 * distributed under the License is distributed on an "AS IS" BASIS, 016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 017 * See the License for the specific language governing permissions and 018 * limitations under the License. 019 * ########################################################################## 020 */ 021import javax.persistence.Column; 022import javax.persistence.Entity; 023import javax.persistence.Id; 024import javax.persistence.IdClass; 025import javax.persistence.Lob; 026import javax.persistence.ManyToOne; 027import javax.persistence.Table; 028import lombok.EqualsAndHashCode; 029import lombok.Getter; 030import lombok.NoArgsConstructor; 031import lombok.Setter; 032import lombok.ToString; 033 034import static javax.persistence.FetchType.LAZY; 035 036/** 037 * {@link Header} {@link Entity}. 038 * 039 * {@bean.info} 040 * 041 * @author {@link.uri mailto:ball@hcf.dev Allen D. Ball} 042 */ 043@Entity 044@Table(catalog = "crossword", name = "header") 045@IdClass(Header.PK.class) 046@NoArgsConstructor @EqualsAndHashCode(callSuper = false) @ToString 047public class Header extends AbstractEntity { 048 @Id @ManyToOne(fetch = LAZY) 049 @Getter @Setter 050 private Crossword crossword = null; 051 052 @Id @Column 053 @Getter @Setter 054 private String name = null; 055 056 @Column @Lob 057 @Getter @Setter 058 private String value = null; 059 060 @NoArgsConstructor @EqualsAndHashCode(callSuper = false) @ToString 061 public static class PK { 062 @Getter @Setter private Crossword crossword = null; 063 @Getter @Setter private String name = null; 064 } 065}