View Javadoc
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.config.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.config.exentity.CrawlingInfoParam;
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 CrawlingInfoParamDbm extends AbstractDBMeta {
36  
37      protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class;
38  
39      // ===================================================================================
40      //                                                                           Singleton
41      //                                                                           =========
42      private static final CrawlingInfoParamDbm _instance = new CrawlingInfoParamDbm();
43  
44      private CrawlingInfoParamDbm() {
45      }
46  
47      public static CrawlingInfoParamDbm 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 -> ((CrawlingInfoParam) et).getCrawlingInfoId(),
83                  (et, vl) -> ((CrawlingInfoParam) et).setCrawlingInfoId(DfTypeUtil.toString(vl)), "crawlingInfoId");
84          setupEpg(_epgMap, et -> ((CrawlingInfoParam) et).getCreatedTime(),
85                  (et, vl) -> ((CrawlingInfoParam) et).setCreatedTime(DfTypeUtil.toLong(vl)), "createdTime");
86          setupEpg(_epgMap, et -> ((CrawlingInfoParam) et).getKey(), (et, vl) -> ((CrawlingInfoParam) et).setKey(DfTypeUtil.toString(vl)),
87                  "key");
88          setupEpg(_epgMap, et -> ((CrawlingInfoParam) et).getValue(), (et, vl) -> ((CrawlingInfoParam) et).setValue(DfTypeUtil.toString(vl)),
89                  "value");
90      }
91  
92      @Override
93      public PropertyGateway findPropertyGateway(final String prop) {
94          return doFindEpg(_epgMap, prop);
95      }
96  
97      // ===================================================================================
98      //                                                                          Table Info
99      //                                                                          ==========
100     protected final String _tableDbName = "crawling_info_param";
101     protected final String _tableDispName = "crawling_info_param";
102     protected final String _tablePropertyName = "CrawlingInfoParam";
103 
104     public String getTableDbName() {
105         return _tableDbName;
106     }
107 
108     @Override
109     public String getTableDispName() {
110         return _tableDispName;
111     }
112 
113     @Override
114     public String getTablePropertyName() {
115         return _tablePropertyName;
116     }
117 
118     @Override
119     public TableSqlName getTableSqlName() {
120         return null;
121     }
122 
123     // ===================================================================================
124     //                                                                         Column Info
125     //                                                                         ===========
126     protected final ColumnInfo _columnCrawlingInfoId = cci("crawlingInfoId", "crawlingInfoId", null, null, String.class, "crawlingInfoId",
127             null, false, false, false, "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
128     protected final ColumnInfo _columnCreatedTime = cci("createdTime", "createdTime", null, null, Long.class, "createdTime", null, false,
129             false, false, "Long", 0, 0, null, null, false, null, null, null, null, null, false);
130     protected final ColumnInfo _columnKey = cci("key", "key", null, null, String.class, "key", null, false, false, false, "keyword", 0, 0,
131             null, null, false, null, null, null, null, null, false);
132     protected final ColumnInfo _columnValue = cci("value", "value", null, null, String.class, "value", null, false, false, false, "keyword",
133             0, 0, null, null, false, null, null, null, null, null, false);
134 
135     public ColumnInfo columnCrawlingInfoId() {
136         return _columnCrawlingInfoId;
137     }
138 
139     public ColumnInfo columnCreatedTime() {
140         return _columnCreatedTime;
141     }
142 
143     public ColumnInfo columnKey() {
144         return _columnKey;
145     }
146 
147     public ColumnInfo columnValue() {
148         return _columnValue;
149     }
150 
151     protected List<ColumnInfo> ccil() {
152         List<ColumnInfo> ls = newArrayList();
153         ls.add(columnCrawlingInfoId());
154         ls.add(columnCreatedTime());
155         ls.add(columnKey());
156         ls.add(columnValue());
157         return ls;
158     }
159 
160     // ===================================================================================
161     //                                                                         Unique Info
162     //                                                                         ===========
163     @Override
164     public boolean hasPrimaryKey() {
165         return false;
166     }
167 
168     @Override
169     public boolean hasCompoundPrimaryKey() {
170         return false;
171     }
172 
173     @Override
174     protected UniqueInfo cpui() {
175         return null;
176     }
177 
178     // ===================================================================================
179     //                                                                           Type Name
180     //                                                                           =========
181     @Override
182     public String getEntityTypeName() {
183         return "org.codelibs.fess.es.config.exentity.CrawlingInfoParam";
184     }
185 
186     @Override
187     public String getConditionBeanTypeName() {
188         return "org.codelibs.fess.es.config.cbean.CrawlingInfoParamCB";
189     }
190 
191     @Override
192     public String getBehaviorTypeName() {
193         return "org.codelibs.fess.es.config.exbhv.CrawlingInfoParamBhv";
194     }
195 
196     // ===================================================================================
197     //                                                                         Object Type
198     //                                                                         ===========
199     @Override
200     public Class<? extends Entity> getEntityType() {
201         return CrawlingInfoParam.class;
202     }
203 
204     // ===================================================================================
205     //                                                                     Object Instance
206     //                                                                     ===============
207     @Override
208     public Entity newEntity() {
209         return new CrawlingInfoParam();
210     }
211 
212     // ===================================================================================
213     //                                                                   Map Communication
214     //                                                                   =================
215     @Override
216     public void acceptPrimaryKeyMap(Entity entity, Map<String, ? extends Object> primaryKeyMap) {
217     }
218 
219     @Override
220     public void acceptAllColumnMap(Entity entity, Map<String, ? extends Object> allColumnMap) {
221     }
222 
223     @Override
224     public Map<String, Object> extractPrimaryKeyMap(Entity entity) {
225         return null;
226     }
227 
228     @Override
229     public Map<String, Object> extractAllColumnMap(Entity entity) {
230         return null;
231     }
232 }