View Javadoc
1   /*
2    * Copyright 2012-2019 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.log.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.log.exentity.SearchLog;
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 SearchLogDbm extends AbstractDBMeta {
36  
37      protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class;
38  
39      // ===================================================================================
40      //                                                                           Singleton
41      //                                                                           =========
42      private static final SearchLogDbmntity/dbmeta/SearchLogDbm.html#SearchLogDbm">SearchLogDbm _instance = new SearchLogDbm();
43  
44      private SearchLogDbm() {
45      }
46  
47      public static SearchLogDbm 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 -> ((SearchLogs/fess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getAccessType(), (et, vl) -> ((SearchLog) et).setAccessType(DfTypeUtil.toString(vl)),
83                  "accessType");
84          setupEpg(_epgMap, et -> ((SearchLogibs/fess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getClientIp(), (et, vl) -> ((SearchLog) et).setClientIp(DfTypeUtil.toString(vl)),
85                  "clientIp");
86          setupEpg(_epgMap, et -> ((SearchLogibs/fess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getHitCount(), (et, vl) -> ((SearchLog) et).setHitCount(DfTypeUtil.toLong(vl)), "hitCount");
87          setupEpg(_epgMap, et -> ((SearchLog) et).getHitCountRelation(),
88                  (et, vl) -> ((SearchLog) et).setHitCountRelation(DfTypeUtil.toString(vl)), "hitCountRelation");
89          setupEpg(_epgMap, et -> ((SearchLogbs/fess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getLanguages(), (et, vl) -> ((SearchLog) et).setLanguages(DfTypeUtil.toString(vl)),
90                  "languages");
91          setupEpg(_epgMap, et -> ((SearchLoglibs/fess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getQueryId(), (et, vl) -> ((SearchLog) et).setQueryId(DfTypeUtil.toString(vl)), "queryId");
92          setupEpg(_epgMap, et -> ((SearchLog/fess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getQueryOffset(), (et, vl) -> ((SearchLog) et).setQueryOffset(DfTypeUtil.toInteger(vl)),
93                  "queryOffset");
94          setupEpg(_epgMap, et -> ((SearchLog) et).getQueryPageSize(),
95                  (et, vl) -> ((SearchLog) et).setQueryPageSize(DfTypeUtil.toInteger(vl)), "queryPageSize");
96          setupEpg(_epgMap, et -> ((SearchLogbs/fess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getQueryTime(), (et, vl) -> ((SearchLog) et).setQueryTime(DfTypeUtil.toLong(vl)),
97                  "queryTime");
98          setupEpg(_epgMap, et -> ((SearchLoglibs/fess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getReferer(), (et, vl) -> ((SearchLog) et).setReferer(DfTypeUtil.toString(vl)), "referer");
99          setupEpg(_epgMap, et -> ((SearchLog) et).getRequestedAt(),
100                 (et, vl) -> ((SearchLog) et).setRequestedAt(DfTypeUtil.toLocalDateTime(vl)), "requestedAt");
101         setupEpg(_epgMap, et -> ((SearchLogfess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getResponseTime(), (et, vl) -> ((SearchLog) et).setResponseTime(DfTypeUtil.toLong(vl)),
102                 "responseTime");
103         setupEpg(_epgMap, et -> ((SearchLogdelibs/fess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getRoles(), (et, vl) -> ((SearchLog) et).setRoles((String[]) vl), "roles");
104         setupEpg(_epgMap, et -> ((SearchLogs/fess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getSearchWord(), (et, vl) -> ((SearchLog) et).setSearchWord(DfTypeUtil.toString(vl)),
105                 "searchWord");
106         setupEpg(_epgMap, et -> ((SearchLogodelibs/fess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getUser(), (et, vl) -> ((SearchLog) et).setUser(DfTypeUtil.toString(vl)), "user");
107         setupEpg(_epgMap, et -> ((SearchLogbs/fess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getUserAgent(), (et, vl) -> ((SearchLog) et).setUserAgent(DfTypeUtil.toString(vl)),
108                 "userAgent");
109         setupEpg(_epgMap, et -> ((SearchLogs/fess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getUserInfoId(), (et, vl) -> ((SearchLog) et).setUserInfoId(DfTypeUtil.toString(vl)),
110                 "userInfoId");
111         setupEpg(_epgMap, et -> ((SearchLog) et).getUserSessionId(),
112                 (et, vl) -> ((SearchLog) et).setUserSessionId(DfTypeUtil.toString(vl)), "userSessionId");
113         setupEpg(_epgMap, et -> ((SearchLog/fess/es/log/exentity/SearchLog.html#SearchLog">SearchLog) et).getVirtualHost(), (et, vl) -> ((SearchLog) et).setVirtualHost(DfTypeUtil.toString(vl)),
114                 "virtualHost");
115     }
116 
117     @Override
118     public PropertyGateway findPropertyGateway(final String prop) {
119         return doFindEpg(_epgMap, prop);
120     }
121 
122     // ===================================================================================
123     //                                                                          Table Info
124     //                                                                          ==========
125     protected final String _tableDbName = "search_log";
126     protected final String _tableDispName = "search_log";
127     protected final String _tablePropertyName = "SearchLog";
128 
129     public String getTableDbName() {
130         return _tableDbName;
131     }
132 
133     @Override
134     public String getTableDispName() {
135         return _tableDispName;
136     }
137 
138     @Override
139     public String getTablePropertyName() {
140         return _tablePropertyName;
141     }
142 
143     @Override
144     public TableSqlName getTableSqlName() {
145         return null;
146     }
147 
148     // ===================================================================================
149     //                                                                         Column Info
150     //                                                                         ===========
151     protected final ColumnInfo _columnAccessType = cci("accessType", "accessType", null, null, String.class, "accessType", null, false,
152             false, false, "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
153     protected final ColumnInfo _columnClientIp = cci("clientIp", "clientIp", null, null, String.class, "clientIp", null, false, false,
154             false, "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
155     protected final ColumnInfo _columnHitCount = cci("hitCount", "hitCount", null, null, Long.class, "hitCount", null, false, false, false,
156             "Long", 0, 0, null, null, false, null, null, null, null, null, false);
157     protected final ColumnInfo _columnHitCountRelation = cci("hitCountRelation", "hitCountRelation", null, null, String.class,
158             "hitCountRelation", null, false, false, false, "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
159     protected final ColumnInfo _columnLanguages = cci("languages", "languages", null, null, String.class, "languages", null, false, false,
160             false, "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
161     protected final ColumnInfo _columnQueryId = cci("queryId", "queryId", null, null, String.class, "queryId", null, false, false, false,
162             "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
163     protected final ColumnInfo _columnQueryOffset = cci("queryOffset", "queryOffset", null, null, Integer.class, "queryOffset", null,
164             false, false, false, "Integer", 0, 0, null, null, false, null, null, null, null, null, false);
165     protected final ColumnInfo _columnQueryPageSize = cci("queryPageSize", "queryPageSize", null, null, Integer.class, "queryPageSize",
166             null, false, false, false, "Integer", 0, 0, null, null, false, null, null, null, null, null, false);
167     protected final ColumnInfo _columnQueryTime = cci("queryTime", "queryTime", null, null, Long.class, "queryTime", null, false, false,
168             false, "Long", 0, 0, null, null, false, null, null, null, null, null, false);
169     protected final ColumnInfo _columnReferer = cci("referer", "referer", null, null, String.class, "referer", null, false, false, false,
170             "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
171     protected final ColumnInfo _columnRequestedAt = cci("requestedAt", "requestedAt", null, null, LocalDateTime.class, "requestedAt", null,
172             false, false, false, "LocalDateTime", 0, 0, null, null, false, null, null, null, null, null, false);
173     protected final ColumnInfo _columnResponseTime = cci("responseTime", "responseTime", null, null, Long.class, "responseTime", null,
174             false, false, false, "Long", 0, 0, null, null, false, null, null, null, null, null, false);
175     protected final ColumnInfo _columnRoles = cci("roles", "roles", null, null, String[].class, "roles", null, false, false, false,
176             "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
177     protected final ColumnInfo _columnSearchWord = cci("searchWord", "searchWord", null, null, String.class, "searchWord", null, false,
178             false, false, "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
179     protected final ColumnInfo _columnUser = cci("user", "user", null, null, String.class, "user", null, false, false, false, "keyword", 0,
180             0, null, null, false, null, null, null, null, null, false);
181     protected final ColumnInfo _columnUserAgent = cci("userAgent", "userAgent", null, null, String.class, "userAgent", null, false, false,
182             false, "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
183     protected final ColumnInfo _columnUserInfoId = cci("userInfoId", "userInfoId", null, null, String.class, "userInfoId", null, false,
184             false, false, "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
185     protected final ColumnInfo _columnUserSessionId = cci("userSessionId", "userSessionId", null, null, String.class, "userSessionId",
186             null, false, false, false, "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
187     protected final ColumnInfo _columnVirtualHost = cci("virtualHost", "virtualHost", null, null, String.class, "virtualHost", null, false,
188             false, false, "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
189 
190     public ColumnInfo columnAccessType() {
191         return _columnAccessType;
192     }
193 
194     public ColumnInfo columnClientIp() {
195         return _columnClientIp;
196     }
197 
198     public ColumnInfo columnHitCount() {
199         return _columnHitCount;
200     }
201 
202     public ColumnInfo columnHitCountRelation() {
203         return _columnHitCountRelation;
204     }
205 
206     public ColumnInfo columnLanguages() {
207         return _columnLanguages;
208     }
209 
210     public ColumnInfo columnQueryId() {
211         return _columnQueryId;
212     }
213 
214     public ColumnInfo columnQueryOffset() {
215         return _columnQueryOffset;
216     }
217 
218     public ColumnInfo columnQueryPageSize() {
219         return _columnQueryPageSize;
220     }
221 
222     public ColumnInfo columnQueryTime() {
223         return _columnQueryTime;
224     }
225 
226     public ColumnInfo columnReferer() {
227         return _columnReferer;
228     }
229 
230     public ColumnInfo columnRequestedAt() {
231         return _columnRequestedAt;
232     }
233 
234     public ColumnInfo columnResponseTime() {
235         return _columnResponseTime;
236     }
237 
238     public ColumnInfo columnRoles() {
239         return _columnRoles;
240     }
241 
242     public ColumnInfo columnSearchWord() {
243         return _columnSearchWord;
244     }
245 
246     public ColumnInfo columnUser() {
247         return _columnUser;
248     }
249 
250     public ColumnInfo columnUserAgent() {
251         return _columnUserAgent;
252     }
253 
254     public ColumnInfo columnUserInfoId() {
255         return _columnUserInfoId;
256     }
257 
258     public ColumnInfo columnUserSessionId() {
259         return _columnUserSessionId;
260     }
261 
262     public ColumnInfo columnVirtualHost() {
263         return _columnVirtualHost;
264     }
265 
266     protected List<ColumnInfo> ccil() {
267         List<ColumnInfo> ls = newArrayList();
268         ls.add(columnAccessType());
269         ls.add(columnClientIp());
270         ls.add(columnHitCount());
271         ls.add(columnHitCountRelation());
272         ls.add(columnLanguages());
273         ls.add(columnQueryId());
274         ls.add(columnQueryOffset());
275         ls.add(columnQueryPageSize());
276         ls.add(columnQueryTime());
277         ls.add(columnReferer());
278         ls.add(columnRequestedAt());
279         ls.add(columnResponseTime());
280         ls.add(columnRoles());
281         ls.add(columnSearchWord());
282         ls.add(columnUser());
283         ls.add(columnUserAgent());
284         ls.add(columnUserInfoId());
285         ls.add(columnUserSessionId());
286         ls.add(columnVirtualHost());
287         return ls;
288     }
289 
290     // ===================================================================================
291     //                                                                         Unique Info
292     //                                                                         ===========
293     @Override
294     public boolean hasPrimaryKey() {
295         return false;
296     }
297 
298     @Override
299     public boolean hasCompoundPrimaryKey() {
300         return false;
301     }
302 
303     @Override
304     protected UniqueInfo cpui() {
305         return null;
306     }
307 
308     // ===================================================================================
309     //                                                                           Type Name
310     //                                                                           =========
311     @Override
312     public String getEntityTypeName() {
313         return "org.codelibs.fess.es.log.exentity.SearchLog";
314     }
315 
316     @Override
317     public String getConditionBeanTypeName() {
318         return "org.codelibs.fess.es.log.cbean.SearchLogCB";
319     }
320 
321     @Override
322     public String getBehaviorTypeName() {
323         return "org.codelibs.fess.es.log.exbhv.SearchLogBhv";
324     }
325 
326     // ===================================================================================
327     //                                                                         Object Type
328     //                                                                         ===========
329     @Override
330     public Class<? extends Entity> getEntityType() {
331         return SearchLog.class;
332     }
333 
334     // ===================================================================================
335     //                                                                     Object Instance
336     //                                                                     ===============
337     @Override
338     public Entity newEntity() {
339         return new SearchLog();
340     }
341 
342     // ===================================================================================
343     //                                                                   Map Communication
344     //                                                                   =================
345     @Override
346     public void acceptPrimaryKeyMap(Entity entity, Map<String, ? extends Object> primaryKeyMap) {
347     }
348 
349     @Override
350     public void acceptAllColumnMap(Entity entity, Map<String, ? extends Object> allColumnMap) {
351     }
352 
353     @Override
354     public Map<String, Object> extractPrimaryKeyMap(Entity entity) {
355         return null;
356     }
357 
358     @Override
359     public Map<String, Object> extractAllColumnMap(Entity entity) {
360         return null;
361     }
362 }