public abstract class DBSession extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DBSession.ALTER_OPERATION |
static class |
DBSession.ENGINE |
| Modifier and Type | Field and Description |
|---|---|
protected Connection |
connection |
protected static String |
CSV_DELIMITER |
protected static org.slf4j.Logger |
logger |
| Modifier | Constructor and Description |
|---|---|
protected |
DBSession()
Deprecated.
|
protected |
DBSession(Connection conn) |
| Modifier and Type | Method and Description |
|---|---|
void |
alterColumn(String tableName,
DBSession.ALTER_OPERATION op,
String... columnsAndConstraintDefinition) |
abstract boolean |
checkExist(String tableName,
List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> keys) |
boolean |
checkTableExist(String tableName) |
void |
close() |
void |
commit() |
void |
createIndex(String tableName,
String columnName) |
abstract void |
createLikeTable(String newTableName,
String oldTable) |
abstract void |
createTable(String tableName,
String[] columnsAndConstraintDefinition) |
void |
deleteColumn(String tableName,
String columnName) |
abstract int |
deleteOperation(String tableName,
List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters) |
void |
disableAutoCommit() |
void |
disableKeys(String tableName) |
void |
dropTable(String table) |
void |
dropView(String view) |
void |
enableKeys(String tableName) |
abstract ResultSet |
executeFilteredQuery(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
String table,
String orderColumn,
org.gcube_system.namespaces.application.aquamaps.types.OrderDirection orderMode) |
ResultSet |
executeQuery(String query)
Deprecated.
|
void |
executeUpdate(String query)
Deprecated.
|
abstract String |
exportTableToCSV(String tableName,
boolean exportHeaders,
char delimiter) |
abstract PreparedStatement |
fillParameters(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields,
int parameterOffset,
PreparedStatement ps) |
protected static String |
formDeletetQueryStringFromFields(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
String table) |
protected static String |
formSelectCountString(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
String tableName) |
protected static String |
formSelectDistinctQueryStringFromFields(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field toSelectField,
String table,
String sortColumn,
org.gcube_system.namespaces.application.aquamaps.types.OrderDirection sortDirection) |
protected static String |
formSelectQueryStringFromFields(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
String table,
String sortColumn,
org.gcube_system.namespaces.application.aquamaps.types.OrderDirection sortDirection) |
protected static String |
formUpdateQuery(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> toSet,
List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> keys,
String tableName) |
Connection |
getConnection() |
abstract Long |
getCount(String tableName,
List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters) |
abstract ResultSet |
getDistinct(org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field toSelect,
List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
String table,
String orderColumn,
org.gcube_system.namespaces.application.aquamaps.types.OrderDirection orderMode) |
abstract PreparedStatement |
getFilterCellByAreaQuery(org.gcube.application.aquamaps.aquamapsservice.stubs.fw.fields.HSPECFields filterByCodeType,
String sourceTableName,
String destinationTableName) |
protected List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> |
getGeneratedKeys(PreparedStatement ps) |
static DBSession |
getInternalDBSession() |
static DBSession |
getPostGisDBSession() |
protected PreparedStatement |
getPreparedStatementForCount(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
String tableName) |
PreparedStatement |
getPreparedStatementForDelete(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields,
String table) |
PreparedStatement |
getPreparedStatementForDISTINCT(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field toSelect,
String table,
String orderColumn,
org.gcube_system.namespaces.application.aquamaps.types.OrderDirection orderDirection) |
PreparedStatement |
getPreparedStatementForInsert(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields,
String table) |
PreparedStatement |
getPreparedStatementForInsertFromSelect(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields,
String destTable,
String srcTable) |
abstract PreparedStatement |
getPreparedStatementForInsertOnDuplicate(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields,
String table,
Integer[] keyIndexes) |
PreparedStatement |
getPreparedStatementForQuery(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
String table,
String orderColumn,
org.gcube_system.namespaces.application.aquamaps.types.OrderDirection orderDirection) |
PreparedStatement |
getPreparedStatementForUpdate(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> toSet,
List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> keys,
String tableName) |
long |
getTableCount(String tableName) |
abstract List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> |
insertOperation(String tableName,
List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> rows) |
PreparedStatement |
preparedStatement(String query)
Deprecated.
|
abstract int |
updateOperation(String tableName,
List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> keys,
List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> rows) |
protected static final org.slf4j.Logger logger
protected static String CSV_DELIMITER
protected Connection connection
protected DBSession(Connection conn)
@Deprecated protected DBSession()
public Connection getConnection()
public static DBSession getInternalDBSession() throws Exception
Exceptionpublic static DBSession getPostGisDBSession() throws Exception
Exception@Deprecated public ResultSet executeQuery(String query) throws Exception
query - Exceptionpublic abstract void createTable(String tableName, String[] columnsAndConstraintDefinition) throws Exception
Exceptionpublic abstract void createLikeTable(String newTableName, String oldTable) throws Exception
Exceptionpublic void alterColumn(String tableName, DBSession.ALTER_OPERATION op, String... columnsAndConstraintDefinition) throws Exception
Exceptionpublic void createIndex(String tableName, String columnName) throws Exception
Exceptionpublic void deleteColumn(String tableName, String columnName) throws Exception
Exceptionpublic abstract PreparedStatement getFilterCellByAreaQuery(org.gcube.application.aquamaps.aquamapsservice.stubs.fw.fields.HSPECFields filterByCodeType, String sourceTableName, String destinationTableName) throws Exception
Exceptionprotected PreparedStatement getPreparedStatementForCount(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, String tableName) throws SQLException
SQLExceptionpublic PreparedStatement getPreparedStatementForQuery(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, String table, String orderColumn, org.gcube_system.namespaces.application.aquamaps.types.OrderDirection orderDirection) throws SQLException
SQLExceptionpublic PreparedStatement getPreparedStatementForDISTINCT(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field toSelect, String table, String orderColumn, org.gcube_system.namespaces.application.aquamaps.types.OrderDirection orderDirection) throws SQLException
SQLExceptionpublic PreparedStatement getPreparedStatementForUpdate(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> toSet, List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> keys, String tableName) throws SQLException
SQLExceptionpublic PreparedStatement getPreparedStatementForInsertFromSelect(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields, String destTable, String srcTable) throws Exception
Exceptionpublic PreparedStatement getPreparedStatementForInsert(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields, String table) throws Exception
Exceptionpublic abstract PreparedStatement getPreparedStatementForInsertOnDuplicate(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields, String table, Integer[] keyIndexes) throws Exception
Exceptionpublic PreparedStatement getPreparedStatementForDelete(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields, String table) throws Exception
Exception@Deprecated public PreparedStatement preparedStatement(String query) throws Exception
Exceptionpublic abstract PreparedStatement fillParameters(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields, int parameterOffset, PreparedStatement ps) throws SQLException
SQLExceptionpublic abstract String exportTableToCSV(String tableName, boolean exportHeaders, char delimiter) throws Exception
Exceptionpublic abstract boolean checkExist(String tableName, List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> keys) throws Exception
Exceptionpublic abstract List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> insertOperation(String tableName, List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> rows) throws Exception
Exceptionpublic abstract int updateOperation(String tableName, List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> keys, List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> rows) throws Exception
Exceptionpublic abstract ResultSet executeFilteredQuery(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, String table, String orderColumn, org.gcube_system.namespaces.application.aquamaps.types.OrderDirection orderMode) throws Exception
Exceptionpublic abstract Long getCount(String tableName, List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters) throws Exception
Exceptionpublic abstract int deleteOperation(String tableName, List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters) throws Exception
Exceptionpublic abstract ResultSet getDistinct(org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field toSelect, List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, String table, String orderColumn, org.gcube_system.namespaces.application.aquamaps.types.OrderDirection orderMode) throws Exception
Exception@Deprecated public void executeUpdate(String query) throws Exception
Exceptionprotected List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> getGeneratedKeys(PreparedStatement ps) throws SQLException
SQLExceptionprotected static String formSelectQueryStringFromFields(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, String table, String sortColumn, org.gcube_system.namespaces.application.aquamaps.types.OrderDirection sortDirection)
protected static String formSelectDistinctQueryStringFromFields(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field toSelectField, String table, String sortColumn, org.gcube_system.namespaces.application.aquamaps.types.OrderDirection sortDirection)
protected static String formSelectCountString(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, String tableName)
protected static String formDeletetQueryStringFromFields(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, String table)
Copyright © 2017. All Rights Reserved.