org.gcube.dataanalysis.ecoengine.utils
Class DatabaseUtils
java.lang.Object
org.gcube.dataanalysis.ecoengine.utils.DatabaseUtils
public class DatabaseUtils
- extends Object
Constructor Summary |
DatabaseUtils(org.hibernate.SessionFactory referencedbConnection)
|
Method Summary |
static String |
addColumnStatement(String tableToUpdate,
String columnName,
String columnKey)
|
String |
buildCreateStatement(String originaltable,
String destinationTable)
|
static void |
closeDBConnection(org.hibernate.SessionFactory dbHibConnection)
|
static String |
copyFileToTableStatement(String file,
String table)
|
static String |
countElementsStatement(String table)
|
static void |
createBigTable(boolean createTable,
String table,
String dbdriver,
String dbuser,
String dbpassword,
String dburl,
String creationStatement,
org.hibernate.SessionFactory dbHibConnection)
|
static String |
createUpdateStatement(String tableToUpdate,
String fieldToUpdate,
String tableFromUpdate,
String columnFromUpdate,
String tableToUpKey,
String tableFromUpKey)
|
static String |
dropTableStatement(String table)
|
static String |
duplicateTableStatement(String tableFrom,
String tableTo)
|
List<Object> |
getColumnDecriptions()
|
String |
getColumnName(int index)
|
static String |
getColumnsElementsStatement(String table,
String columns,
String filter)
|
String |
getColumnType(int index)
|
static String |
getDinstictElements(String table,
String column,
String filter)
|
static String |
getOrderedElements(String table,
String key,
String column)
|
String |
getPrimaryKey()
|
static org.hibernate.SessionFactory |
initDBSession(AlgorithmConfiguration config)
|
static String |
insertFromBuffer(String table,
String columnsNames,
StringBuffer values)
|
static String |
insertIntoColumn(String table,
String keyColumnName,
String valueColumnName,
List<Object> couplesColumnAndKeys)
|
static String |
sumElementsStatement(String table,
String column)
|
static String |
update(String table,
String valueColumnName,
String value,
String keyColumnName,
String key)
|
static String |
updateColumn(String table,
String keyColumnName,
String valueColumnName,
List<Object> couplesColumnAndKeys)
|
static String |
updateTableColumnFromOther(String tableName,
String fieldToUpdate,
String otherTable,
String otherColumn,
String keyColumn,
String otherKeyColumn)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DatabaseUtils
public DatabaseUtils(org.hibernate.SessionFactory referencedbConnection)
createUpdateStatement
public static String createUpdateStatement(String tableToUpdate,
String fieldToUpdate,
String tableFromUpdate,
String columnFromUpdate,
String tableToUpKey,
String tableFromUpKey)
addColumnStatement
public static String addColumnStatement(String tableToUpdate,
String columnName,
String columnKey)
getPrimaryKey
public String getPrimaryKey()
getColumnDecriptions
public List<Object> getColumnDecriptions()
getColumnName
public String getColumnName(int index)
getColumnType
public String getColumnType(int index)
duplicateTableStatement
public static String duplicateTableStatement(String tableFrom,
String tableTo)
dropTableStatement
public static String dropTableStatement(String table)
getDinstictElements
public static String getDinstictElements(String table,
String column,
String filter)
getOrderedElements
public static String getOrderedElements(String table,
String key,
String column)
sumElementsStatement
public static String sumElementsStatement(String table,
String column)
getColumnsElementsStatement
public static String getColumnsElementsStatement(String table,
String columns,
String filter)
countElementsStatement
public static String countElementsStatement(String table)
update
public static String update(String table,
String valueColumnName,
String value,
String keyColumnName,
String key)
insertIntoColumn
public static String insertIntoColumn(String table,
String keyColumnName,
String valueColumnName,
List<Object> couplesColumnAndKeys)
insertFromBuffer
public static String insertFromBuffer(String table,
String columnsNames,
StringBuffer values)
copyFileToTableStatement
public static String copyFileToTableStatement(String file,
String table)
updateTableColumnFromOther
public static String updateTableColumnFromOther(String tableName,
String fieldToUpdate,
String otherTable,
String otherColumn,
String keyColumn,
String otherKeyColumn)
updateColumn
public static String updateColumn(String table,
String keyColumnName,
String valueColumnName,
List<Object> couplesColumnAndKeys)
buildCreateStatement
public String buildCreateStatement(String originaltable,
String destinationTable)
createBigTable
public static void createBigTable(boolean createTable,
String table,
String dbdriver,
String dbuser,
String dbpassword,
String dburl,
String creationStatement,
org.hibernate.SessionFactory dbHibConnection)
throws Exception
- Throws:
Exception
initDBSession
public static org.hibernate.SessionFactory initDBSession(AlgorithmConfiguration config)
closeDBConnection
public static void closeDBConnection(org.hibernate.SessionFactory dbHibConnection)
Copyright © 2012. All Rights Reserved.