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.UserInfo;
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 UserInfoDbm extends AbstractDBMeta {
36  
37      protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class;
38  
39      // ===================================================================================
40      //                                                                           Singleton
41      //                                                                           =========
42      private static final UserInfoDbm _instance = new UserInfoDbm();
43  
44      private UserInfoDbm() {
45      }
46  
47      public static UserInfoDbm 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 -> ((UserInfo) et).getCreatedAt(), (et, vl) -> ((UserInfo) et).setCreatedAt(DfTypeUtil.toLocalDateTime(vl)),
83                  "createdAt");
84          setupEpg(_epgMap, et -> ((UserInfo) et).getUpdatedAt(), (et, vl) -> ((UserInfo) et).setUpdatedAt(DfTypeUtil.toLocalDateTime(vl)),
85                  "updatedAt");
86      }
87  
88      @Override
89      public PropertyGateway findPropertyGateway(final String prop) {
90          return doFindEpg(_epgMap, prop);
91      }
92  
93      // ===================================================================================
94      //                                                                          Table Info
95      //                                                                          ==========
96      protected final String _tableDbName = "user_info";
97      protected final String _tableDispName = "user_info";
98      protected final String _tablePropertyName = "UserInfo";
99  
100     public String getTableDbName() {
101         return _tableDbName;
102     }
103 
104     @Override
105     public String getTableDispName() {
106         return _tableDispName;
107     }
108 
109     @Override
110     public String getTablePropertyName() {
111         return _tablePropertyName;
112     }
113 
114     @Override
115     public TableSqlName getTableSqlName() {
116         return null;
117     }
118 
119     // ===================================================================================
120     //                                                                         Column Info
121     //                                                                         ===========
122     protected final ColumnInfo _columnCreatedAt = cci("createdAt", "createdAt", null, null, LocalDateTime.class, "createdAt", null, false,
123             false, false, "LocalDateTime", 0, 0, null, null, false, null, null, null, null, null, false);
124     protected final ColumnInfo _columnUpdatedAt = cci("updatedAt", "updatedAt", null, null, LocalDateTime.class, "updatedAt", null, false,
125             false, false, "LocalDateTime", 0, 0, null, null, false, null, null, null, null, null, false);
126 
127     public ColumnInfo columnCreatedAt() {
128         return _columnCreatedAt;
129     }
130 
131     public ColumnInfo columnUpdatedAt() {
132         return _columnUpdatedAt;
133     }
134 
135     protected List<ColumnInfo> ccil() {
136         List<ColumnInfo> ls = newArrayList();
137         ls.add(columnCreatedAt());
138         ls.add(columnUpdatedAt());
139         return ls;
140     }
141 
142     // ===================================================================================
143     //                                                                         Unique Info
144     //                                                                         ===========
145     @Override
146     public boolean hasPrimaryKey() {
147         return false;
148     }
149 
150     @Override
151     public boolean hasCompoundPrimaryKey() {
152         return false;
153     }
154 
155     @Override
156     protected UniqueInfo cpui() {
157         return null;
158     }
159 
160     // ===================================================================================
161     //                                                                           Type Name
162     //                                                                           =========
163     @Override
164     public String getEntityTypeName() {
165         return "org.codelibs.fess.es.log.exentity.UserInfo";
166     }
167 
168     @Override
169     public String getConditionBeanTypeName() {
170         return "org.codelibs.fess.es.log.cbean.UserInfoCB";
171     }
172 
173     @Override
174     public String getBehaviorTypeName() {
175         return "org.codelibs.fess.es.log.exbhv.UserInfoBhv";
176     }
177 
178     // ===================================================================================
179     //                                                                         Object Type
180     //                                                                         ===========
181     @Override
182     public Class<? extends Entity> getEntityType() {
183         return UserInfo.class;
184     }
185 
186     // ===================================================================================
187     //                                                                     Object Instance
188     //                                                                     ===============
189     @Override
190     public Entity newEntity() {
191         return new UserInfo();
192     }
193 
194     // ===================================================================================
195     //                                                                   Map Communication
196     //                                                                   =================
197     @Override
198     public void acceptPrimaryKeyMap(Entity entity, Map<String, ? extends Object> primaryKeyMap) {
199     }
200 
201     @Override
202     public void acceptAllColumnMap(Entity entity, Map<String, ? extends Object> allColumnMap) {
203     }
204 
205     @Override
206     public Map<String, Object> extractPrimaryKeyMap(Entity entity) {
207         return null;
208     }
209 
210     @Override
211     public Map<String, Object> extractAllColumnMap(Entity entity) {
212         return null;
213     }
214 }