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.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.FavoriteLog;
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 FavoriteLogDbm extends AbstractDBMeta {
36  
37      protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class;
38  
39      // ===================================================================================
40      //                                                                           Singleton
41      //                                                                           =========
42      private static final FavoriteLogDbm _instance = new FavoriteLogDbm();
43  
44      private FavoriteLogDbm() {
45      }
46  
47      public static FavoriteLogDbm 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 -> ((FavoriteLog) et).getCreatedAt(),
83                  (et, vl) -> ((FavoriteLog) et).setCreatedAt(DfTypeUtil.toLocalDateTime(vl)), "createdAt");
84          setupEpg(_epgMap, et -> ((FavoriteLog) et).getDocId(), (et, vl) -> ((FavoriteLog) et).setDocId(DfTypeUtil.toString(vl)), "docId");
85          setupEpg(_epgMap, et -> ((FavoriteLog) et).getQueryId(), (et, vl) -> ((FavoriteLog) et).setQueryId(DfTypeUtil.toString(vl)),
86                  "queryId");
87          setupEpg(_epgMap, et -> ((FavoriteLog) et).getUrl(), (et, vl) -> ((FavoriteLog) et).setUrl(DfTypeUtil.toString(vl)), "url");
88          setupEpg(_epgMap, et -> ((FavoriteLog) et).getUserInfoId(), (et, vl) -> ((FavoriteLog) et).setUserInfoId(DfTypeUtil.toString(vl)),
89                  "userInfoId");
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 = "favorite_log";
101     protected final String _tableDispName = "favorite_log";
102     protected final String _tablePropertyName = "FavoriteLog";
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 _columnCreatedAt = cci("createdAt", "createdAt", null, null, LocalDateTime.class, "createdAt", null, false,
127             false, false, "LocalDateTime", 0, 0, null, null, false, null, null, null, null, null, false);
128     protected final ColumnInfo _columnDocId = cci("docId", "docId", null, null, String.class, "docId", null, false, false, false, "keyword",
129             0, 0, null, null, false, null, null, null, null, null, false);
130     protected final ColumnInfo _columnQueryId = cci("queryId", "queryId", null, null, String.class, "queryId", null, false, false, false,
131             "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
132     protected final ColumnInfo _columnUrl = cci("url", "url", null, null, String.class, "url", null, false, false, false, "keyword", 0, 0,
133             null, null, false, null, null, null, null, null, false);
134     protected final ColumnInfo _columnUserInfoId = cci("userInfoId", "userInfoId", null, null, String.class, "userInfoId", null, false,
135             false, false, "keyword", 0, 0, null, null, false, null, null, null, null, null, false);
136 
137     public ColumnInfo columnCreatedAt() {
138         return _columnCreatedAt;
139     }
140 
141     public ColumnInfo columnDocId() {
142         return _columnDocId;
143     }
144 
145     public ColumnInfo columnQueryId() {
146         return _columnQueryId;
147     }
148 
149     public ColumnInfo columnUrl() {
150         return _columnUrl;
151     }
152 
153     public ColumnInfo columnUserInfoId() {
154         return _columnUserInfoId;
155     }
156 
157     protected List<ColumnInfo> ccil() {
158         List<ColumnInfo> ls = newArrayList();
159         ls.add(columnCreatedAt());
160         ls.add(columnDocId());
161         ls.add(columnQueryId());
162         ls.add(columnUrl());
163         ls.add(columnUserInfoId());
164         return ls;
165     }
166 
167     // ===================================================================================
168     //                                                                         Unique Info
169     //                                                                         ===========
170     @Override
171     public boolean hasPrimaryKey() {
172         return false;
173     }
174 
175     @Override
176     public boolean hasCompoundPrimaryKey() {
177         return false;
178     }
179 
180     @Override
181     protected UniqueInfo cpui() {
182         return null;
183     }
184 
185     // ===================================================================================
186     //                                                                           Type Name
187     //                                                                           =========
188     @Override
189     public String getEntityTypeName() {
190         return "org.codelibs.fess.es.log.exentity.FavoriteLog";
191     }
192 
193     @Override
194     public String getConditionBeanTypeName() {
195         return "org.codelibs.fess.es.log.cbean.FavoriteLogCB";
196     }
197 
198     @Override
199     public String getBehaviorTypeName() {
200         return "org.codelibs.fess.es.log.exbhv.FavoriteLogBhv";
201     }
202 
203     // ===================================================================================
204     //                                                                         Object Type
205     //                                                                         ===========
206     @Override
207     public Class<? extends Entity> getEntityType() {
208         return FavoriteLog.class;
209     }
210 
211     // ===================================================================================
212     //                                                                     Object Instance
213     //                                                                     ===============
214     @Override
215     public Entity newEntity() {
216         return new FavoriteLog();
217     }
218 
219     // ===================================================================================
220     //                                                                   Map Communication
221     //                                                                   =================
222     @Override
223     public void acceptPrimaryKeyMap(Entity entity, Map<String, ? extends Object> primaryKeyMap) {
224     }
225 
226     @Override
227     public void acceptAllColumnMap(Entity entity, Map<String, ? extends Object> allColumnMap) {
228     }
229 
230     @Override
231     public Map<String, Object> extractPrimaryKeyMap(Entity entity) {
232         return null;
233     }
234 
235     @Override
236     public Map<String, Object> extractAllColumnMap(Entity entity) {
237         return null;
238     }
239 }