org.gcube.application.aquamaps.aquamapsservice.impl.db
Class MySQLDBSession

java.lang.Object
  extended by org.gcube.application.aquamaps.aquamapsservice.impl.db.DBSession
      extended by org.gcube.application.aquamaps.aquamapsservice.impl.db.MySQLDBSession

public class MySQLDBSession
extends DBSession


Nested Class Summary
 
Nested classes/interfaces inherited from class org.gcube.application.aquamaps.aquamapsservice.impl.db.DBSession
DBSession.ALTER_OPERATION, DBSession.ENGINE
 
Field Summary
 
Fields inherited from class org.gcube.application.aquamaps.aquamapsservice.impl.db.DBSession
connection, CSV_DELIMITER, DEFAULT_BOOLEAN_VALUE, DEFAULT_DOUBLE_VALUE, DEFAULT_INTEGER_VALUE, DEFAULT_LONG_VALUE, logger
 
Constructor Summary
MySQLDBSession(Connection conn)
           
 
Method Summary
 boolean checkExist(String tableName, List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field> keys)
           
 void createLikeTable(String newTableName, String oldTable)
           
 void createTable(String tableName, String[] columnsAndConstraintDefinition)
           
 void createTable(String tableName, String[] columnsAndConstraintDefinition, int numParitions, String partitioningKey, DBSession.ENGINE... engines)
           
 int deleteOperation(String tableName, List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field> filters)
           
 ResultSet executeFilteredQuery(List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field> filters, String table, String orderColumn, org.gcube_system.namespaces.application.aquamaps.types.OrderDirection orderMode)
           
 String exportTableToCSV(String tableName, boolean hasHeaders, char delimiter)
           
 PreparedStatement fillParameters(List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field> fields, int parameterOffset, PreparedStatement ps)
           
 Long getCount(String tableName, List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field> filters)
           
 ResultSet getDistinct(org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field toSelect, List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field> filters, String table, String orderColumn, org.gcube_system.namespaces.application.aquamaps.types.OrderDirection orderMode)
           
 PreparedStatement getFilterCellByAreaQuery(org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.fields.HSPECFields filterByCodeType, String sourceTableName, String destinationTableName)
           
 PreparedStatement getPreparedStatementForInsertOnDuplicate(List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field> fields, String table, Integer[] keyIndexes)
           
 List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field>> insertOperation(String tableName, List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field>> rows)
           
 int updateOperation(String tableName, List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field>> keys, List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field>> rows)
           
 
Methods inherited from class org.gcube.application.aquamaps.aquamapsservice.impl.db.DBSession
alterColumn, checkTableExist, close, commit, createIndex, deleteColumn, disableAutoCommit, disableKeys, dropTable, dropView, enableKeys, executeQuery, executeUpdate, formDeletetQueryStringFromFields, formSelectCountString, formSelectDistinctQueryStringFromFields, formSelectQueryStringFromFields, formUpdateQuery, getConnection, getGeneratedKeys, getInternalCredentials, getInternalDBSession, getPostGisCredentials, getPostGisDBSession, getPreparedStatementForCount, getPreparedStatementForDelete, getPreparedStatementForDISTINCT, getPreparedStatementForInsert, getPreparedStatementForInsertFromSelect, getPreparedStatementForQuery, getPreparedStatementForUpdate, getTableCount, preparedStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySQLDBSession

public MySQLDBSession(Connection conn)
Method Detail

executeFilteredQuery

public ResultSet executeFilteredQuery(List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field> filters,
                                      String table,
                                      String orderColumn,
                                      org.gcube_system.namespaces.application.aquamaps.types.OrderDirection orderMode)
                               throws Exception
Specified by:
executeFilteredQuery in class DBSession
Throws:
Exception

fillParameters

public PreparedStatement fillParameters(List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field> fields,
                                        int parameterOffset,
                                        PreparedStatement ps)
                                 throws SQLException
Specified by:
fillParameters in class DBSession
Throws:
SQLException

checkExist

public boolean checkExist(String tableName,
                          List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field> keys)
                   throws Exception
Specified by:
checkExist in class DBSession
Throws:
Exception

deleteOperation

public int deleteOperation(String tableName,
                           List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field> filters)
                    throws Exception
Specified by:
deleteOperation in class DBSession
Throws:
Exception

getCount

public Long getCount(String tableName,
                     List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field> filters)
              throws Exception
Specified by:
getCount in class DBSession
Throws:
Exception

getFilterCellByAreaQuery

public PreparedStatement getFilterCellByAreaQuery(org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.fields.HSPECFields filterByCodeType,
                                                  String sourceTableName,
                                                  String destinationTableName)
                                           throws Exception
Specified by:
getFilterCellByAreaQuery in class DBSession
Throws:
Exception

insertOperation

public List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field>> insertOperation(String tableName,
                                                                                                                 List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field>> rows)
                                                                                                          throws Exception
Specified by:
insertOperation in class DBSession
Throws:
Exception

updateOperation

public int updateOperation(String tableName,
                           List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field>> keys,
                           List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field>> rows)
                    throws Exception
Specified by:
updateOperation in class DBSession
Throws:
Exception

createTable

public void createTable(String tableName,
                        String[] columnsAndConstraintDefinition,
                        int numParitions,
                        String partitioningKey,
                        DBSession.ENGINE... engines)
                 throws Exception
Throws:
Exception

createLikeTable

public void createLikeTable(String newTableName,
                            String oldTable)
                     throws Exception
Specified by:
createLikeTable in class DBSession
Throws:
Exception

createTable

public void createTable(String tableName,
                        String[] columnsAndConstraintDefinition)
                 throws Exception
Specified by:
createTable in class DBSession
Throws:
Exception

getPreparedStatementForInsertOnDuplicate

public PreparedStatement getPreparedStatementForInsertOnDuplicate(List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field> fields,
                                                                  String table,
                                                                  Integer[] keyIndexes)
                                                           throws Exception
Specified by:
getPreparedStatementForInsertOnDuplicate in class DBSession
Throws:
Exception

getDistinct

public ResultSet getDistinct(org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field toSelect,
                             List<org.gcube.application.aquamaps.aquamapsservice.stubs.datamodel.enhanced.Field> filters,
                             String table,
                             String orderColumn,
                             org.gcube_system.namespaces.application.aquamaps.types.OrderDirection orderMode)
                      throws Exception
Specified by:
getDistinct in class DBSession
Throws:
Exception

exportTableToCSV

public String exportTableToCSV(String tableName,
                               boolean hasHeaders,
                               char delimiter)
                        throws Exception
Specified by:
exportTableToCSV in class DBSession
Throws:
Exception


Copyright © 2013. All Rights Reserved.