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.Role;
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 RoleDbm extends AbstractDBMeta {
36
37 protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class;
38
39 // ===================================================================================
40 // Singleton
41 // =========
42 private static final RoleDbm _instance = new RoleDbm();
43
44 private RoleDbm() {
45 }
46
47 public static RoleDbm 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 -> ((Role) et).getName(), (et, vl) -> ((Role) et).setName(DfTypeUtil.toString(vl)), "name");
83 }
84
85 @Override
86 public PropertyGateway findPropertyGateway(final String prop) {
87 return doFindEpg(_epgMap, prop);
88 }
89
90 // ===================================================================================
91 // Table Info
92 // ==========
93 protected final String _tableDbName = "role";
94 protected final String _tableDispName = "role";
95 protected final String _tablePropertyName = "Role";
96
97 public String getTableDbName() {
98 return _tableDbName;
99 }
100
101 @Override
102 public String getTableDispName() {
103 return _tableDispName;
104 }
105
106 @Override
107 public String getTablePropertyName() {
108 return _tablePropertyName;
109 }
110
111 @Override
112 public TableSqlName getTableSqlName() {
113 return null;
114 }
115
116 // ===================================================================================
117 // Column Info
118 // ===========
119 protected final ColumnInfo _columnName = cci("name", "name", null, null, String.class, "name", null, false, false, false, "keyword", 0,
120 0, null, null, false, null, null, null, null, null, false);
121
122 public ColumnInfo columnName() {
123 return _columnName;
124 }
125
126 protected List<ColumnInfo> ccil() {
127 List<ColumnInfo> ls = newArrayList();
128 ls.add(columnName());
129 return ls;
130 }
131
132 // ===================================================================================
133 // Unique Info
134 // ===========
135 @Override
136 public boolean hasPrimaryKey() {
137 return false;
138 }
139
140 @Override
141 public boolean hasCompoundPrimaryKey() {
142 return false;
143 }
144
145 @Override
146 protected UniqueInfo cpui() {
147 return null;
148 }
149
150 // ===================================================================================
151 // Type Name
152 // =========
153 @Override
154 public String getEntityTypeName() {
155 return "org.codelibs.fess.es.user.exentity.Role";
156 }
157
158 @Override
159 public String getConditionBeanTypeName() {
160 return "org.codelibs.fess.es.user.cbean.RoleCB";
161 }
162
163 @Override
164 public String getBehaviorTypeName() {
165 return "org.codelibs.fess.es.user.exbhv.RoleBhv";
166 }
167
168 // ===================================================================================
169 // Object Type
170 // ===========
171 @Override
172 public Class<? extends Entity> getEntityType() {
173 return Role.class;
174 }
175
176 // ===================================================================================
177 // Object Instance
178 // ===============
179 @Override
180 public Entity newEntity() {
181 return new Role();
182 }
183
184 // ===================================================================================
185 // Map Communication
186 // =================
187 @Override
188 public void acceptPrimaryKeyMap(Entity entity, Map<String, ? extends Object> primaryKeyMap) {
189 }
190
191 @Override
192 public void acceptAllColumnMap(Entity entity, Map<String, ? extends Object> allColumnMap) {
193 }
194
195 @Override
196 public Map<String, Object> extractPrimaryKeyMap(Entity entity) {
197 return null;
198 }
199
200 @Override
201 public Map<String, Object> extractAllColumnMap(Entity entity) {
202 return null;
203 }
204 }