/* * Copyright 2012-2017 CodeLibs Project and the Others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.codelibs.fess.es.config.bsentity.dbmeta; import java.time.LocalDateTime; import java.util.List; import java.util.Map; import org.codelibs.fess.es.config.exentity.CrawlingInfo; import org.dbflute.Entity; import org.dbflute.dbmeta.AbstractDBMeta; import org.dbflute.dbmeta.info.ColumnInfo; import org.dbflute.dbmeta.info.UniqueInfo; import org.dbflute.dbmeta.name.TableSqlName; import org.dbflute.dbmeta.property.PropertyGateway; import org.dbflute.dbway.DBDef; import org.dbflute.util.DfTypeUtil; /** * @author ESFlute (using FreeGen) */ public class CrawlingInfoDbm extends AbstractDBMeta { protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class; // =================================================================================== // Singleton // ========= private static final CrawlingInfoDbm _instance = new CrawlingInfoDbm(); private CrawlingInfoDbm() { } public static CrawlingInfoDbm getInstance() { return _instance; } // =================================================================================== // Current DBDef // ============= @Override public String getProjectName() { return null; } @Override public String getProjectPrefix() { return null; } @Override public String getGenerationGapBasePrefix() { return null; } @Override public DBDef getCurrentDBDef() { return null; } // =================================================================================== // Property Gateway // ================ // ----------------------------------------------------- // Column Property // --------------- protected final Map<String, PropertyGateway> _epgMap = newHashMap(); { setupEpg(_epgMap, et -> ((CrawlingInfo) et).getCreatedTime(), (et, vl) -> ((CrawlingInfo) et).setCreatedTime(DfTypeUtil.toLong(vl)), "createdTime"); setupEpg(_epgMap, et -> ((CrawlingInfo) et).getExpiredTime(), (et, vl) -> ((CrawlingInfo) et).setExpiredTime(DfTypeUtil.toLong(vl)), "expiredTime"); setupEpg(_epgMap, et -> ((CrawlingInfo) et).getName(), (et, vl) -> ((CrawlingInfo) et).setName(DfTypeUtil.toString(vl)), "name"); setupEpg(_epgMap, et -> ((CrawlingInfo) et).getSessionId(), (et, vl) -> ((CrawlingInfo) et).setSessionId(DfTypeUtil.toString(vl)), "sessionId"); } @Override public PropertyGateway findPropertyGateway(final String prop) { return doFindEpg(_epgMap, prop); } // =================================================================================== // Table Info // ========== protected final String _tableDbName = "crawling_info"; protected final String _tableDispName = "crawling_info"; protected final String _tablePropertyName = "CrawlingInfo"; public String getTableDbName() { return _tableDbName; } @Override public String getTableDispName() { return _tableDispName; } @Override public String getTablePropertyName() { return _tablePropertyName; } @Override public TableSqlName getTableSqlName() { return null; } // =================================================================================== // Column Info // =========== protected final ColumnInfo _columnCreatedTime = cci("createdTime", "createdTime", null, null, Long.class, "createdTime", null, false, false, false, "Long", 0, 0, null, false, null, null, null, null, null, false); protected final ColumnInfo _columnExpiredTime = cci("expiredTime", "expiredTime", null, null, Long.class, "expiredTime", null, false, false, false, "Long", 0, 0, null, false, null, null, null, null, null, false); protected final ColumnInfo _columnName = cci("name", "name", null, null, String.class, "name", null, false, false, false, "keyword", 0, 0, null, false, null, null, null, null, null, false); protected final ColumnInfo _columnSessionId = cci("sessionId", "sessionId", null, null, String.class, "sessionId", null, false, false, false, "keyword", 0, 0, null, false, null, null, null, null, null, false); public ColumnInfo columnCreatedTime() { return _columnCreatedTime; } public ColumnInfo columnExpiredTime() { return _columnExpiredTime; } public ColumnInfo columnName() { return _columnName; } public ColumnInfo columnSessionId() { return _columnSessionId; } protected List<ColumnInfo> ccil() { List<ColumnInfo> ls = newArrayList(); ls.add(columnCreatedTime()); ls.add(columnExpiredTime()); ls.add(columnName()); ls.add(columnSessionId()); return ls; } // =================================================================================== // Unique Info // =========== @Override public boolean hasPrimaryKey() { return false; } @Override public boolean hasCompoundPrimaryKey() { return false; } @Override protected UniqueInfo cpui() { return null; } // =================================================================================== // Type Name // ========= @Override public String getEntityTypeName() { return "org.codelibs.fess.es.config.exentity.CrawlingInfo"; } @Override public String getConditionBeanTypeName() { return "org.codelibs.fess.es.config.cbean.CrawlingInfoCB"; } @Override public String getBehaviorTypeName() { return "org.codelibs.fess.es.config.exbhv.CrawlingInfoBhv"; } // =================================================================================== // Object Type // =========== @Override public Class<? extends Entity> getEntityType() { return CrawlingInfo.class; } // =================================================================================== // Object Instance // =============== @Override public Entity newEntity() { return new CrawlingInfo(); } // =================================================================================== // Map Communication // ================= @Override public void acceptPrimaryKeyMap(Entity entity, Map<String, ? extends Object> primaryKeyMap) { } @Override public void acceptAllColumnMap(Entity entity, Map<String, ? extends Object> allColumnMap) { } @Override public Map<String, Object> extractPrimaryKeyMap(Entity entity) { return null; } @Override public Map<String, Object> extractAllColumnMap(Entity entity) { return null; } }