1 /*
2 * Copyright 2012-2021 CodeLibs Project and the Others.
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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,
13 * either express or implied. See the License for the specific language
14 * governing permissions and limitations under the License.
15 */
16 package org.codelibs.fess.es.user.bsentity.dbmeta;
17
18 import java.time.LocalDateTime;
19 import java.util.List;
20 import java.util.Map;
21
22 import org.codelibs.fess.es.user.exentity.Group;
23 import org.dbflute.Entity;
24 import org.dbflute.dbmeta.AbstractDBMeta;
25 import org.dbflute.dbmeta.info.ColumnInfo;
26 import org.dbflute.dbmeta.info.UniqueInfo;
27 import org.dbflute.dbmeta.name.TableSqlName;
28 import org.dbflute.dbmeta.property.PropertyGateway;
29 import org.dbflute.dbway.DBDef;
30 import org.dbflute.util.DfTypeUtil;
31
32 /**
33 * @author ESFlute (using FreeGen)
34 */
35 public class GroupDbm extends AbstractDBMeta {
36
37 protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class;
38
39 // ===================================================================================
40 // Singleton
41 // =========
42 private static final GroupDbm _instance = new GroupDbm();
43
44 private GroupDbm() {
45 }
46
47 public static GroupDbm getInstance() {
48 return _instance;
49 }
50
51 // ===================================================================================
52 // Current DBDef
53 // =============
54 @Override
55 public String getProjectName() {
56 return null;
57 }
58
59 @Override
60 public String getProjectPrefix() {
61 return null;
62 }
63
64 @Override
65 public String getGenerationGapBasePrefix() {
66 return null;
67 }
68
69 @Override
70 public DBDef getCurrentDBDef() {
71 return null;
72 }
73
74 // ===================================================================================
75 // Property Gateway
76 // ================
77 // -----------------------------------------------------
78 // Column Property
79 // ---------------
80 protected final Map<String, PropertyGateway> _epgMap = newHashMap();
81 {
82 setupEpg(_epgMap, et -> ((Group) et).getGidNumber(), (et, vl) -> ((Group) et).setGidNumber(DfTypeUtil.toLong(vl)), "gidNumber");
83 setupEpg(_epgMap, et -> ((Group) et).getName(), (et, vl) -> ((Group) et).setName(DfTypeUtil.toString(vl)), "name");
84 }
85
86 @Override
87 public PropertyGateway findPropertyGateway(final String prop) {
88 return doFindEpg(_epgMap, prop);
89 }
90
91 // ===================================================================================
92 // Table Info
93 // ==========
94 protected final String _tableDbName = "group";
95 protected final String _tableDispName = "group";
96 protected final String _tablePropertyName = "Group";
97
98 public String getTableDbName() {
99 return _tableDbName;
100 }
101
102 @Override
103 public String getTableDispName() {
104 return _tableDispName;
105 }
106
107 @Override
108 public String getTablePropertyName() {
109 return _tablePropertyName;
110 }
111
112 @Override
113 public TableSqlName getTableSqlName() {
114 return null;
115 }
116
117 // ===================================================================================
118 // Column Info
119 // ===========
120 protected final ColumnInfo _columnGidNumber = cci("gidNumber", "gidNumber", null, null, Long.class, "gidNumber", null, false, false,
121 false, "Long", 0, 0, null, null, false, null, null, null, null, null, false);
122 protected final ColumnInfo _columnName = cci("name", "name", null, null, String.class, "name", null, false, false, false, "keyword", 0,
123 0, null, null, false, null, null, null, null, null, false);
124
125 public ColumnInfo columnGidNumber() {
126 return _columnGidNumber;
127 }
128
129 public ColumnInfo columnName() {
130 return _columnName;
131 }
132
133 protected List<ColumnInfo> ccil() {
134 List<ColumnInfo> ls = newArrayList();
135 ls.add(columnGidNumber());
136 ls.add(columnName());
137 return ls;
138 }
139
140 // ===================================================================================
141 // Unique Info
142 // ===========
143 @Override
144 public boolean hasPrimaryKey() {
145 return false;
146 }
147
148 @Override
149 public boolean hasCompoundPrimaryKey() {
150 return false;
151 }
152
153 @Override
154 protected UniqueInfo cpui() {
155 return null;
156 }
157
158 // ===================================================================================
159 // Type Name
160 // =========
161 @Override
162 public String getEntityTypeName() {
163 return "org.codelibs.fess.es.user.exentity.Group";
164 }
165
166 @Override
167 public String getConditionBeanTypeName() {
168 return "org.codelibs.fess.es.user.cbean.GroupCB";
169 }
170
171 @Override
172 public String getBehaviorTypeName() {
173 return "org.codelibs.fess.es.user.exbhv.GroupBhv";
174 }
175
176 // ===================================================================================
177 // Object Type
178 // ===========
179 @Override
180 public Class<? extends Entity> getEntityType() {
181 return Group.class;
182 }
183
184 // ===================================================================================
185 // Object Instance
186 // ===============
187 @Override
188 public Entity newEntity() {
189 return new Group();
190 }
191
192 // ===================================================================================
193 // Map Communication
194 // =================
195 @Override
196 public void acceptPrimaryKeyMap(Entity entity, Map<String, ? extends Object> primaryKeyMap) {
197 }
198
199 @Override
200 public void acceptAllColumnMap(Entity entity, Map<String, ? extends Object> allColumnMap) {
201 }
202
203 @Override
204 public Map<String, Object> extractPrimaryKeyMap(Entity entity) {
205 return null;
206 }
207
208 @Override
209 public Map<String, Object> extractAllColumnMap(Entity entity) {
210 return null;
211 }
212 }