/* * 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.LabelToRole; 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 LabelToRoleDbm extends AbstractDBMeta { protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class; // =================================================================================== // Singleton // ========= private static final LabelToRoleDbm _instance = new LabelToRoleDbm(); private LabelToRoleDbm() { } public static LabelToRoleDbm 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 -> ((LabelToRole) et).getLabelTypeId(), (et, vl) -> ((LabelToRole) et).setLabelTypeId(DfTypeUtil.toString(vl)), "labelTypeId"); setupEpg(_epgMap, et -> ((LabelToRole) et).getRoleTypeId(), (et, vl) -> ((LabelToRole) et).setRoleTypeId(DfTypeUtil.toString(vl)), "roleTypeId"); } @Override public PropertyGateway findPropertyGateway(final String prop) { return doFindEpg(_epgMap, prop); } // =================================================================================== // Table Info // ========== protected final String _tableDbName = "label_to_role"; protected final String _tableDispName = "label_to_role"; protected final String _tablePropertyName = "LabelToRole"; 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 _columnLabelTypeId = cci("labelTypeId", "labelTypeId", null, null, String.class, "labelTypeId", null, false, false, false, "keyword", 0, 0, null, false, null, null, null, null, null, false); protected final ColumnInfo _columnRoleTypeId = cci("roleTypeId", "roleTypeId", null, null, String.class, "roleTypeId", null, false, false, false, "keyword", 0, 0, null, false, null, null, null, null, null, false); public ColumnInfo columnLabelTypeId() { return _columnLabelTypeId; } public ColumnInfo columnRoleTypeId() { return _columnRoleTypeId; } protected List<ColumnInfo> ccil() { List<ColumnInfo> ls = newArrayList(); ls.add(columnLabelTypeId()); ls.add(columnRoleTypeId()); 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.LabelToRole"; } @Override public String getConditionBeanTypeName() { return "org.codelibs.fess.es.config.cbean.LabelToRoleCB"; } @Override public String getBehaviorTypeName() { return "org.codelibs.fess.es.config.exbhv.LabelToRoleBhv"; } // =================================================================================== // Object Type // =========== @Override public Class<? extends Entity> getEntityType() { return LabelToRole.class; } // =================================================================================== // Object Instance // =============== @Override public Entity newEntity() { return new LabelToRole(); } // =================================================================================== // 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; } }