2 * Copyright (c) 2018. Developed by Hedgecode.
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.hedgecode.chess.domain;
19 import javax.persistence.Column;
20 import javax.persistence.Entity;
21 import javax.persistence.GeneratedValue;
22 import javax.persistence.GenerationType;
23 import javax.persistence.Id;
24 import javax.persistence.NamedQueries;
25 import javax.persistence.NamedQuery;
26 import javax.persistence.Table;
31 * @author Dmitry Samoshin aka gotty
39 name = EtudeType.FIND_ALL,
40 query = "select et from EtudeType et"
43 name = EtudeType.FIND_BY_ID,
44 query = "select et from EtudeType et where et.id = :id"
47 name = EtudeType.FIND_BY_BRIEF,
48 query = "select et from EtudeType et where et.brief = :brief"
51 public class EtudeType extends DomainObject<EtudeType> {
53 public static final String FIND_ALL = "EtudeType.findAll";
54 public static final String FIND_BY_ID = "EtudeType.findById";
55 public static final String FIND_BY_BRIEF = "EtudeType.findByBrief";
57 public static final String BRIEF_PARAMETER = "brief";
64 strategy = GenerationType.AUTO
69 name = "f_brief", nullable = false
74 name = "f_name", nullable = false
79 name = "f_description"
81 private String description;
83 public <TargetType> TargetType assemble(TargetType target, EtudeTypeAdapter<TargetType> adapter) {
84 adapter.setId(target, id);
85 adapter.setBrief(target, brief);
86 adapter.setName(target, name);
87 adapter.setDescription(target, description);