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