io.leopard.autounit.unitdb
Class DatabaseScriptImpl
java.lang.Object
io.leopard.autounit.unitdb.DatabaseScriptImpl
- All Implemented Interfaces:
- DatabaseScript
public class DatabaseScriptImpl
- extends java.lang.Object
- implements DatabaseScript
|
Method Summary |
protected void |
dropTable(java.lang.String tableName)
|
protected java.lang.String |
generateSql(java.lang.Class<?> entityClazz,
java.lang.String tableName)
|
protected boolean |
isKey(java.lang.reflect.Field field)
|
protected java.lang.String |
parseTableName(java.lang.String sql)
解析表名称 |
boolean |
populate(java.lang.Class<?> entityClazz,
java.lang.String tableName)
|
boolean |
populate(java.lang.Class<?> entityClazz,
java.lang.String tableName,
boolean dropTable)
|
static boolean |
populate(javax.sql.DataSource dataSource,
java.lang.Class<?> entityClazz,
java.lang.String tableName)
|
boolean |
populate(java.lang.String sql)
|
boolean |
populate(java.lang.String sql,
boolean dropTable)
|
void |
setDataSource(javax.sql.DataSource dataSource)
|
protected java.lang.String |
toDataType(java.lang.reflect.Field field)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DatabaseScriptImpl
public DatabaseScriptImpl()
setDataSource
public void setDataSource(javax.sql.DataSource dataSource)
populate
public boolean populate(java.lang.Class<?> entityClazz,
java.lang.String tableName)
- Specified by:
populate in interface DatabaseScript
isKey
protected boolean isKey(java.lang.reflect.Field field)
toDataType
protected java.lang.String toDataType(java.lang.reflect.Field field)
generateSql
protected java.lang.String generateSql(java.lang.Class<?> entityClazz,
java.lang.String tableName)
populate
public boolean populate(java.lang.Class<?> entityClazz,
java.lang.String tableName,
boolean dropTable)
- Specified by:
populate in interface DatabaseScript
populate
public boolean populate(java.lang.String sql)
- Specified by:
populate in interface DatabaseScript
parseTableName
protected java.lang.String parseTableName(java.lang.String sql)
- 解析表名称
- Parameters:
sql -
- Returns:
dropTable
protected void dropTable(java.lang.String tableName)
populate
public boolean populate(java.lang.String sql,
boolean dropTable)
- Specified by:
populate in interface DatabaseScript
populate
public static boolean populate(javax.sql.DataSource dataSource,
java.lang.Class<?> entityClazz,
java.lang.String tableName)
Copyright © 2014-2015. All Rights Reserved.