View Javadoc
1   /*
2    * Copyright 2012-2025 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.opensearch.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.opensearch.config.exentity.BoostDocumentRule;
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 BoostDocumentRuleDbm extends AbstractDBMeta {
36  
37      protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class;
38  
39      // ===================================================================================
40      //                                                                           Singleton
41      //                                                                           =========
42      private static final BoostDocumentRuleDbm _instance = new BoostDocumentRuleDbm();
43  
44      private BoostDocumentRuleDbm() {
45      }
46  
47      public static BoostDocumentRuleDbm 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 -> ((BoostDocumentRule) et).getBoostExpr(),
83                  (et, vl) -> ((BoostDocumentRule) et).setBoostExpr(DfTypeUtil.toString(vl)), "boostExpr");
84          setupEpg(_epgMap, et -> ((BoostDocumentRule) et).getCreatedBy(),
85                  (et, vl) -> ((BoostDocumentRule) et).setCreatedBy(DfTypeUtil.toString(vl)), "createdBy");
86          setupEpg(_epgMap, et -> ((BoostDocumentRule) et).getCreatedTime(),
87                  (et, vl) -> ((BoostDocumentRule) et).setCreatedTime(DfTypeUtil.toLong(vl)), "createdTime");
88          setupEpg(_epgMap, et -> ((BoostDocumentRule) et).getSortOrder(),
89                  (et, vl) -> ((BoostDocumentRule) et).setSortOrder(DfTypeUtil.toInteger(vl)), "sortOrder");
90          setupEpg(_epgMap, et -> ((BoostDocumentRule) et).getUpdatedBy(),
91                  (et, vl) -> ((BoostDocumentRule) et).setUpdatedBy(DfTypeUtil.toString(vl)), "updatedBy");
92          setupEpg(_epgMap, et -> ((BoostDocumentRule) et).getUpdatedTime(),
93                  (et, vl) -> ((BoostDocumentRule) et).setUpdatedTime(DfTypeUtil.toLong(vl)), "updatedTime");
94          setupEpg(_epgMap, et -> ((BoostDocumentRule) et).getUrlExpr(),
95                  (et, vl) -> ((BoostDocumentRule) et).setUrlExpr(DfTypeUtil.toString(vl)), "urlExpr");
96      }
97  
98      @Override
99      public PropertyGateway findPropertyGateway(final String prop) {
100         return doFindEpg(_epgMap, prop);
101     }
102 
103     // ===================================================================================
104     //                                                                          Table Info
105     //                                                                          ==========
106     protected final String _tableDbName = "boost_document_rule";
107     protected final String _tableDispName = "boost_document_rule";
108     protected final String _tablePropertyName = "BoostDocumentRule";
109 
110     public String getTableDbName() {
111         return _tableDbName;
112     }
113 
114     @Override
115     public String getTableDispName() {
116         return _tableDispName;
117     }
118 
119     @Override
120     public String getTablePropertyName() {
121         return _tablePropertyName;
122     }
123 
124     @Override
125     public TableSqlName getTableSqlName() {
126         return null;
127     }
128 
129     // ===================================================================================
130     //                                                                         Column Info
131     //                                                                         ===========
132     protected final ColumnInfo _columnBoostExpr = cci("boostExpr", "boostExpr", null, null, String.class, "boostExpr", null, false, false,
133             false, "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
134     protected final ColumnInfo _columnCreatedBy = cci("createdBy", "createdBy", null, null, String.class, "createdBy", null, false, false,
135             false, "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
136     protected final ColumnInfo _columnCreatedTime = cci("createdTime", "createdTime", null, null, Long.class, "createdTime", null, false,
137             false, false, "Long", 0, 0, null, null, false, null, null, null, null, null, false);
138     protected final ColumnInfo _columnSortOrder = cci("sortOrder", "sortOrder", null, null, Integer.class, "sortOrder", null, false, false,
139             false, "Integer", 0, 0, null, null, false, null, null, null, null, null, false);
140     protected final ColumnInfo _columnUpdatedBy = cci("updatedBy", "updatedBy", null, null, String.class, "updatedBy", null, false, false,
141             false, "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
142     protected final ColumnInfo _columnUpdatedTime = cci("updatedTime", "updatedTime", null, null, Long.class, "updatedTime", null, false,
143             false, false, "Long", 0, 0, null, null, false, null, null, null, null, null, false);
144     protected final ColumnInfo _columnUrlExpr = cci("urlExpr", "urlExpr", null, null, String.class, "urlExpr", null, false, false, false,
145             "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
146 
147     public ColumnInfo columnBoostExpr() {
148         return _columnBoostExpr;
149     }
150 
151     public ColumnInfo columnCreatedBy() {
152         return _columnCreatedBy;
153     }
154 
155     public ColumnInfo columnCreatedTime() {
156         return _columnCreatedTime;
157     }
158 
159     public ColumnInfo columnSortOrder() {
160         return _columnSortOrder;
161     }
162 
163     public ColumnInfo columnUpdatedBy() {
164         return _columnUpdatedBy;
165     }
166 
167     public ColumnInfo columnUpdatedTime() {
168         return _columnUpdatedTime;
169     }
170 
171     public ColumnInfo columnUrlExpr() {
172         return _columnUrlExpr;
173     }
174 
175     protected List<ColumnInfo> ccil() {
176         List<ColumnInfo> ls = newArrayList();
177         ls.add(columnBoostExpr());
178         ls.add(columnCreatedBy());
179         ls.add(columnCreatedTime());
180         ls.add(columnSortOrder());
181         ls.add(columnUpdatedBy());
182         ls.add(columnUpdatedTime());
183         ls.add(columnUrlExpr());
184         return ls;
185     }
186 
187     // ===================================================================================
188     //                                                                         Unique Info
189     //                                                                         ===========
190     @Override
191     public boolean hasPrimaryKey() {
192         return false;
193     }
194 
195     @Override
196     public boolean hasCompoundPrimaryKey() {
197         return false;
198     }
199 
200     @Override
201     protected UniqueInfo cpui() {
202         return null;
203     }
204 
205     // ===================================================================================
206     //                                                                           Type Name
207     //                                                                           =========
208     @Override
209     public String getEntityTypeName() {
210         return "org.codelibs.fess.opensearch.config.exentity.BoostDocumentRule";
211     }
212 
213     @Override
214     public String getConditionBeanTypeName() {
215         return "org.codelibs.fess.opensearch.config.cbean.BoostDocumentRuleCB";
216     }
217 
218     @Override
219     public String getBehaviorTypeName() {
220         return "org.codelibs.fess.opensearch.config.exbhv.BoostDocumentRuleBhv";
221     }
222 
223     // ===================================================================================
224     //                                                                         Object Type
225     //                                                                         ===========
226     @Override
227     public Class<? extends Entity> getEntityType() {
228         return BoostDocumentRule.class;
229     }
230 
231     // ===================================================================================
232     //                                                                     Object Instance
233     //                                                                     ===============
234     @Override
235     public Entity newEntity() {
236         return new BoostDocumentRule();
237     }
238 
239     // ===================================================================================
240     //                                                                   Map Communication
241     //                                                                   =================
242     @Override
243     public void acceptPrimaryKeyMap(Entity entity, Map<String, ? extends Object> primaryKeyMap) {
244     }
245 
246     @Override
247     public void acceptAllColumnMap(Entity entity, Map<String, ? extends Object> allColumnMap) {
248     }
249 
250     @Override
251     public Map<String, Object> extractPrimaryKeyMap(Entity entity) {
252         return null;
253     }
254 
255     @Override
256     public Map<String, Object> extractAllColumnMap(Entity entity) {
257         return null;
258     }
259 }