public class StatementTransformAdapter extends Object implements StatementTransform
| Modifier and Type | Field and Description |
|---|---|
protected BeanDbNameConverter |
beanDbNameConverter |
protected Configuration |
configuration |
protected String |
schema |
| Constructor and Description |
|---|
StatementTransformAdapter() |
StatementTransformAdapter(Configuration configuration) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkBeanPropertyNull(Bean bean,
String columnName) |
protected List<String> |
getColumnNames(Bean bean)
获取操作的所有数据库字段名称
|
protected List<Object> |
getConditionParams(Bean bean) |
protected String |
getConditionSql(List<String> conditionColumns,
Bean bean) |
protected String |
getDeleteSql(Bean bean,
List<String> conditionColumns)
获取删除对象的sql语句,以及所需的参数的property列表
|
protected String |
getFullTableName(String beanType) |
protected String |
getInsertSql(Bean bean)
创建新增sql
|
String |
getSchema() |
protected String |
getTableName(TableConfiguration table) |
protected String |
getTableNameWithSchame(String tableName) |
protected String |
getUpdateSql(Bean bean,
List<String> conditionColumns) |
void |
setConfiguration(Configuration configuration) |
void |
setSchema(String schema) |
String |
toDelete(Bean bean) |
String |
toInsert(Bean bean) |
SqlAndValues |
toSelect(Bean bean) |
String |
toUpdate(Bean bean) |
protected Configuration configuration
protected BeanDbNameConverter beanDbNameConverter
protected String schema
public StatementTransformAdapter()
public StatementTransformAdapter(Configuration configuration)
public void setConfiguration(Configuration configuration)
public String getSchema()
public void setSchema(String schema)
public SqlAndValues toSelect(Bean bean) throws TinyDbException
toSelect in interface StatementTransformTinyDbExceptionpublic String toInsert(Bean bean) throws TinyDbException
toInsert in interface StatementTransformTinyDbExceptionpublic String toDelete(Bean bean) throws TinyDbException
toDelete in interface StatementTransformTinyDbExceptionpublic String toUpdate(Bean bean) throws TinyDbException
toUpdate in interface StatementTransformTinyDbExceptionprotected List<String> getColumnNames(Bean bean)
bean - protected String getTableName(TableConfiguration table)
protected String getInsertSql(Bean bean) throws TinyDbException
bean - TinyDbExceptionprotected String getDeleteSql(Bean bean, List<String> conditionColumns) throws TinyDbException
beanType - conditionColumns - TinyDbExceptionprotected String getUpdateSql(Bean bean, List<String> conditionColumns) throws TinyDbException
bean - conditionColumns - sql中用到的字段的列表,包括 update table set * where *两个*区域用到的所有字段
外部传进来的空列表,由此函数进行填充,字段按在sql中使用的先后顺序放入列表TinyDbExceptionCopyright © 2006–2018 TinyGroup. All rights reserved.