public abstract class AbstractJdbcExpert extends Object implements JdbcExpert
Modifier and Type | Field and Description |
---|---|
protected JdbcExpertConfigFile |
conf
提供给子类使用的配置文件对象
|
protected Set<String> |
keywords |
Constructor and Description |
---|
AbstractJdbcExpert(JdbcExpertConfigFile conf) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createEntity, getDatabaseType
protected JdbcExpertConfigFile conf
public AbstractJdbcExpert(JdbcExpertConfigFile conf)
public void setupEntityField(Connection conn, Entity<?> en)
JdbcExpert
实体类在解析的时候会用到这个函数
setupEntityField
in interface JdbcExpert
conn
- 数据库连接en
- 实体public ValueAdaptor getAdaptor(MappingField ef)
JdbcExpert
getAdaptor
in interface JdbcExpert
ef
- 实体数据库映射字段public Pojo createPojo(SqlType type)
JdbcExpert
createPojo
in interface JdbcExpert
type
- POJO 语句的 SQL 类型SqlType
public boolean dropEntity(Dao dao, Entity<?> en)
JdbcExpert
dropEntity
in interface JdbcExpert
en
- 实体public Map<String,Object> getConf()
getConf
in interface JdbcExpert
public void createRelation(Dao dao, Entity<?> en)
createRelation
in interface JdbcExpert
public void dropRelation(Dao dao, Entity<?> en)
dropRelation
in interface JdbcExpert
public String evalFieldType(MappingField mf)
evalFieldType
in interface JdbcExpert
protected static List<DaoStatement> wrap(String... sqls)
protected static List<DaoStatement> wrap(List<String> sqls)
protected String getDefaultValue(MappingField mf)
public Sql createIndexSql(Entity<?> en, EntityIndex index)
createIndexSql
in interface JdbcExpert
public void formatQuery(DaoStatement daoStatement)
JdbcExpert
formatQuery
in interface JdbcExpert
daoStatement
- Dao 语句public abstract void formatQuery(Pojo pojo)
public void formatQuery(Sql sql)
public Pojo fetchPojoId(Entity<?> en, MappingField idField)
fetchPojoId
in interface JdbcExpert
public boolean isSupportAutoIncrement()
isSupportAutoIncrement
in interface JdbcExpert
public void addDefaultValue(StringBuilder sb, MappingField mf)
public boolean addColumnNeedColumn()
addColumnNeedColumn
in interface JdbcExpert
public boolean supportTimestampDefault()
supportTimestampDefault
in interface JdbcExpert
public void setKeywords(Set<String> keywords)
setKeywords
in interface JdbcExpert
public String wrapKeywork(String columnName, boolean force)
wrapKeywork
in interface JdbcExpert
public boolean isSupportGeneratedKeys()
isSupportGeneratedKeys
in interface JdbcExpert
public void checkDataSource(Connection conn) throws SQLException
checkDataSource
in interface JdbcExpert
SQLException
public Sql createAddColumnSql(Entity<?> en, MappingField mf)
createAddColumnSql
in interface JdbcExpert
public boolean canCommentWhenAddIndex()
canCommentWhenAddIndex
in interface JdbcExpert
public List<String> getIndexNames(Entity<?> en, Connection conn) throws SQLException
getIndexNames
in interface JdbcExpert
SQLException
Copyright © 2017. All rights reserved.