|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.BatchUtil
class BatchUtil
Utility class for batching information.
Field Summary | |
---|---|
private static boolean |
debugEnabled
So we don't always have to call logSql.debug() |
private static boolean |
isInitialised
|
private static Logger |
logSql
Log all SQL statements. |
private static Map<String,List<BatchedPropertyInfo>> |
propertyDeleteOrders
Mapping classes/entity names to property update orders. |
private static Map<String,List<BatchedPropertyInfo>> |
propertyInsertOrders
Mapping classes/entity names to property insert orders. |
private static Map<String,List<BatchedPropertyInfo>> |
propertyUpdateOrders
Mapping classes/entity names to property delete orders. |
private static Map<String,String> |
sqlDeletes
Mapping classes/entity names to SQL deletes. |
private static Map<String,String> |
sqlInserts
Mapping classes/entity names to SQL inserts. |
private static Map<String,String> |
sqlUpdates
Mapping classes/entity names to SQL updates. |
Constructor Summary | |
---|---|
BatchUtil()
|
Method Summary | |
---|---|
private static void |
buildDelete(String entityName,
org.hibernate.dialect.Dialect dialect)
Build delete SQL string and put it in the SQL map. |
private static void |
buildInsert(String entityName,
org.hibernate.dialect.Dialect dialect)
Build insert SQL string and put it in the SQL map. |
(package private) static String |
buildInsertSelectSql(VirtualDb vdb,
VirtualTable table,
VirtualColumn[] columns,
String selectSql)
|
(package private) static String |
buildInsertSql(VirtualDb vdb,
VirtualTable table,
VirtualColumn[] columns,
Object[] values)
|
private static void |
buildUpdate(String entityName,
org.hibernate.dialect.Dialect dialect)
Build update SQL string and put it in the SQL map. |
(package private) static List<BatchedPropertyInfo> |
getDeletePropertyOrder(Class<? extends BatchableData> dataClass)
Get the order of properties in the delete SQL. |
(package private) static List<BatchedPropertyInfo> |
getDeletePropertyOrder(String entityName)
Get the order of properties in the delete SQL. |
(package private) static String |
getDeleteSql(Class<? extends BatchableData> dataClass)
Get the SQL that deletes a new row of the specified class. |
(package private) static String |
getDeleteSql(String entityName)
Get the SQL that deletes a new row of the specified class. |
(package private) static List<BatchedPropertyInfo> |
getInsertPropertyOrder(Class<? extends BatchableData> dataClass)
Get the order of properties in the insert SQL. |
(package private) static List<BatchedPropertyInfo> |
getInsertPropertyOrder(String entityName)
Get the order of properties in the insert SQL. |
(package private) static String |
getInsertSql(Class<? extends BatchableData> dataClass)
Get the SQL that inserts a new row of the specified class. |
(package private) static String |
getInsertSql(String entityName)
Get the SQL that inserts a new row of the specified class. |
(package private) static List<BatchedPropertyInfo> |
getUpdatePropertyOrder(Class<? extends BatchableData> dataClass)
Get the order of properties in the update SQL. |
(package private) static List<BatchedPropertyInfo> |
getUpdatePropertyOrder(String entityName)
Get the order of properties in the update SQL. |
(package private) static String |
getUpdateSql(Class<? extends BatchableData> dataClass)
Get the SQL that updates a new row of the specified class. |
(package private) static String |
getUpdateSql(String entityName)
Get the SQL that updates a new row of the specified class. |
(package private) static void |
init()
Generate SQL for all BatchableData classes for insert, update and delete operations. |
(package private) static void |
unload()
Unload all settings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Logger logSql
private static final boolean debugEnabled
private static Map<String,List<BatchedPropertyInfo>> propertyInsertOrders
private static Map<String,List<BatchedPropertyInfo>> propertyUpdateOrders
private static Map<String,List<BatchedPropertyInfo>> propertyDeleteOrders
private static Map<String,String> sqlInserts
private static Map<String,String> sqlUpdates
private static Map<String,String> sqlDeletes
private static boolean isInitialised
Constructor Detail |
---|
BatchUtil()
Method Detail |
---|
static void init()
static void unload()
static String getInsertSql(Class<? extends BatchableData> dataClass)
dataClass
- Get the insert SQL for this class
static String getInsertSql(String entityName)
entityName
- The entity name
static String getUpdateSql(Class<? extends BatchableData> dataClass)
dataClass
- Get the update SQL for this class
static String getUpdateSql(String entityName)
entityName
- The entity name
static String getDeleteSql(Class<? extends BatchableData> dataClass)
dataClass
- Get the delete SQL for this class
static String getDeleteSql(String entityName)
entityName
- The entity name
static List<BatchedPropertyInfo> getInsertPropertyOrder(Class<? extends BatchableData> dataClass)
dataClass
- Get the property order for this class
static List<BatchedPropertyInfo> getInsertPropertyOrder(String entityName)
entityName
- The entity name
static List<BatchedPropertyInfo> getUpdatePropertyOrder(Class<? extends BatchableData> dataClass)
dataClass
- Get the property order for this class.
static List<BatchedPropertyInfo> getUpdatePropertyOrder(String entityName)
entityName
- The entity name
static List<BatchedPropertyInfo> getDeletePropertyOrder(Class<? extends BatchableData> dataClass)
dataClass
- Get the property order for this class.
static List<BatchedPropertyInfo> getDeletePropertyOrder(String entityName)
entityName
- The entity name
static String buildInsertSql(VirtualDb vdb, VirtualTable table, VirtualColumn[] columns, Object[] values)
static String buildInsertSelectSql(VirtualDb vdb, VirtualTable table, VirtualColumn[] columns, String selectSql)
private static void buildInsert(String entityName, org.hibernate.dialect.Dialect dialect)
entityName
- The name of the class to generate the SQL for,
the name is usually the same as the class name, but doesn't have to bedialect
- The database dialect in useprivate static void buildUpdate(String entityName, org.hibernate.dialect.Dialect dialect)
entityName
- The name of the class to generate the SQL for,
the name is usually the same as the class name, but doesn't have to bedialect
- The database dialect in useprivate static void buildDelete(String entityName, org.hibernate.dialect.Dialect dialect)
entityName
- The name of the class to generate the SQL for,
the name is usually the same as the class name, but doesn't have to bedialect
- The database dialect in use
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |