com.sibvisions.rad.persist.jdbc
Class HanaDBAccess

java.lang.Object
  extended by com.sibvisions.rad.persist.jdbc.DBAccess
      extended by com.sibvisions.rad.persist.jdbc.HanaDBAccess
All Implemented Interfaces:
IDBAccess, ICloseable

public class HanaDBAccess
extends DBAccess

The HanaDBAccess is the implementation for SAP HANA databases.

See Also:
DBAccess

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sibvisions.rad.persist.jdbc.DBAccess
DBAccess.BlobFileHandle, DBAccess.ParameterizedStatement
 
Field Summary
 
Fields inherited from class com.sibvisions.rad.persist.jdbc.DBAccess
BFILE, LONGNVARCHAR, NCHAR, NCLOB, NVARCHAR, QUOTE, SQLXML, TIMESTAMPWITHLOCALTIMEZONE, TIMESTAMPWITHTIMEZONE
 
Constructor Summary
HanaDBAccess()
          Constructs a new HanaDBAccess Object.
 
Method Summary
protected  void commitOrRollbackBeforeClose()
          Calls commit or rollback before closing the connection.
protected  java.lang.String getColumnName(java.sql.ResultSetMetaData pMetaData, int pColumn)
          Gets the column name from the given resultset metadata.
protected  java.util.Map<java.lang.String,java.lang.Object> getDefaultValuesIntern(java.lang.String pCatalog, java.lang.String pSchema, java.lang.String pTable)
          Gets all default column values of a specific table.
protected  java.util.List<ForeignKey> getForeignKeysIntern(java.lang.String pCatalog, java.lang.String pSchema, java.lang.String pTable)
          Returns all Foreign Keys for the specified table.
protected  TableInfo getTableInfoIntern(java.lang.String pWriteBackTable)
          Returns the meta data information for the specified query, and configures all columns with defaults.
protected  java.util.List<Key> getUniqueKeysIntern(java.lang.String pCatalog, java.lang.String pSchema, java.lang.String pTable)
          It gets all columns for each Unique Key and return it.
 java.lang.Object[] insert(java.lang.String pWriteBackTable, ServerMetaData pServerMetaData, java.lang.Object[] pNewDataRow)
          Returns the newly inserted row from the write back table.
 java.lang.Object[] insertDatabaseSpecific(java.lang.String pWriteBackTable, java.lang.String pInsertStatement, ServerMetaData pServerMetaData, java.lang.Object[] pNewDataRow, java.lang.String pDummyColumn)
          Returns the newly inserted row from a Database specific insert statement.
protected  java.lang.Object[] insertHana(java.lang.String pWriteBackTable, java.lang.String pInsertStatement, ServerMetaData pServerMetaData, java.lang.Object[] pNewDataRow, java.lang.String pDummyColumn)
          Returns the newly inserted row from a SAP Hana Database.
 
Methods inherited from class com.sibvisions.rad.persist.jdbc.DBAccess
clearMetaData, clearMetaData, close, commit, convertDatabaseSpecificObjectToValue, convertValueToDatabaseSpecificObject, createIdentifier, createReplace, createServerColumnMetaData, createWhereColumn, createWhereParam, debug, delete, detectModified, error, eventConfigureConnection, eventUnconfigureConnection, executeFunction, executeFunction, executeProcedure, executeQuery, executeSql, executeSqlMulti, executeStatement, fetch, fetch, fetch, fetch, findAndCreateReducedCondition, findNamedParameters, fireEventConfigureConnection, fireEventUnconfigureConnection, formatSQLException, formatSQLException, getAllowedValues, getAllowedValuesIntern, getAutomaticLinkColumnNameTranslation, getCloseQuoteCharacter, getColumnMetaData, getColumnMetaDataCreator, getColumnMetaDataIntern, getConnection, getConnectionIntern, getConnectionPool, getDatabaseSpecificLockStatement, getDBAccess, getDBAccess, getDBAccess, getDBAccess, getDBAccess, getDBProperties, getDBProperty, getDefaultAllowedValues, getDefaultCursorCacheTimeout, getDefaultLargeObjectLimit, getDefaultSchema, getDefaultValues, getDiscardRowCount, getDriver, getForeignKeys, getIdentifier, getLargeObjectLimit, getMaxColumnLength, getMaxTime, getMetaDataCacheOption, getMetaDataWhereClause, getObjectFromResultSet, getObjectFromResultSet, getOpenQuoteCharacter, getParameter, getParameter, getParameterizedSelectStatement, getPassword, getPreparedStatement, getPreparedStatement, getPrimaryKey, getPrimaryKeyIntern, getQueryTimeout, getRealQueryColumnName, getSelectStatement, getSelectStatement, getSQL, getTableForSynonym, getTableForSynonymIntern, getTableInfo, getTransactionTimeout, getUniqueKeys, getUrl, getUsername, getWhereClause, info, initializeColumnMetaData, initializeDataType, initializeServerColumnMetaData, insertAnsiSQL, isAutoCommit, isAutoQuote, isConnectionPoolEnabled, isJdbc, isLogEnabled, isMetaDataCacheEnabled, isModified, isOpen, isReleaseConnectionPending, isTypeEqual, lockRow, lockRowInternal, open, prepareConnection, quote, quoteAllways, registerDBAccessClass, releaseConnection, releaseConnectionIntern, removeDBSpecificQuotes, removeQuotes, rollback, setAutoCommit, setAutomaticLinkColumnNameTranslation, setColumnMetaDataCreator, setColumnMetaDataCreator, setColumnsToStore, setConnection, setConnectionPool, setConnectionPoolEnabled, setDBProperties, setDBProperty, setDefaultCursorCacheTimeout, setDefaultLargeObjectLimit, setDefaultSchema, setDriver, setLargeObjectLimit, setMaxTime, setMetaDataCacheOption, setModified, setPassword, setQueryTimeout, setQuoteCharacters, setTransactionTimeout, setUrl, setUsername, splitSchemaTable, supportsGetGeneratedKeys, toString, translateDefaultValue, translateQuotes, translateValue, update, updateAnsiSQL, updateDatabaseSpecific
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HanaDBAccess

public HanaDBAccess()
Constructs a new HanaDBAccess Object.

Method Detail

insert

public java.lang.Object[] insert(java.lang.String pWriteBackTable,
                                 ServerMetaData pServerMetaData,
                                 java.lang.Object[] pNewDataRow)
                          throws DataSourceException
Returns the newly inserted row from the write back table.

Specified by:
insert in interface IDBAccess
Overrides:
insert in class DBAccess
Parameters:
pWriteBackTable - the write back table to use.
pServerMetaData - the meta data to use.
pNewDataRow - the new values Object[] to insert.
Returns:
the newly inserted row as Object[] from the write back table.
Throws:
DataSourceException - if an Exception occur during insert the row to the table

insertDatabaseSpecific

public java.lang.Object[] insertDatabaseSpecific(java.lang.String pWriteBackTable,
                                                 java.lang.String pInsertStatement,
                                                 ServerMetaData pServerMetaData,
                                                 java.lang.Object[] pNewDataRow,
                                                 java.lang.String pDummyColumn)
                                          throws DataSourceException
Returns the newly inserted row from a Database specific insert statement.
Database specific derivations of DBAccess need to implement it database specific.

Overrides:
insertDatabaseSpecific in class DBAccess
Parameters:
pWriteBackTable - the table to use for the insert
pInsertStatement - the SQL Statement to use for the insert
pServerMetaData - the meta data to use.
pNewDataRow - the new row (Object[]) with the values to insert
pDummyColumn - null, if all writeable columns are null, but for a correct INSERT it have to be minimum one column to use in the syntax.
Returns:
the newly inserted row from an Oracle Database.
Throws:
DataSourceException - if an Exception occur during insert to the storage

getTableInfoIntern

protected TableInfo getTableInfoIntern(java.lang.String pWriteBackTable)
                                throws DataSourceException
Returns the meta data information for the specified query, and configures all columns with defaults.

Overrides:
getTableInfoIntern in class DBAccess
Parameters:
pWriteBackTable - the write back table to use for the isWriteable() state (Optional)
Returns:
the meta data for the specified query, and initials all columns.
Throws:
DataSourceException - if an Exception occur during getting the meta data or if the storage is not opened or if one columns SQL type is not supported

getColumnName

protected java.lang.String getColumnName(java.sql.ResultSetMetaData pMetaData,
                                         int pColumn)
                                  throws java.sql.SQLException
Gets the column name from the given resultset metadata.

Overrides:
getColumnName in class DBAccess
Parameters:
pMetaData - the metadata
pColumn - the column index
Returns:
the column name
Throws:
java.sql.SQLException - if accessing metadata failed

getDefaultValuesIntern

protected java.util.Map<java.lang.String,java.lang.Object> getDefaultValuesIntern(java.lang.String pCatalog,
                                                                                  java.lang.String pSchema,
                                                                                  java.lang.String pTable)
                                                                           throws DataSourceException
Gets all default column values of a specific table.

Overrides:
getDefaultValuesIntern in class DBAccess
Parameters:
pCatalog - the catalog name
pSchema - the schema name
pTable - the table name
Returns:
a Hashtable with the column name as key and the default value as value. It only contains columns with a default value
Throws:
DataSourceException - if the database access throws an exception

getUniqueKeysIntern

protected java.util.List<Key> getUniqueKeysIntern(java.lang.String pCatalog,
                                                  java.lang.String pSchema,
                                                  java.lang.String pTable)
                                           throws DataSourceException
It gets all columns for each Unique Key and return it.

Overrides:
getUniqueKeysIntern in class DBAccess
Parameters:
pCatalog - the catalog to use
pSchema - the schema to use
pTable - the table to use
Returns:
all columns for each Unique Key.
Throws:
DataSourceException - if an error occur during UK search process.

getForeignKeysIntern

protected java.util.List<ForeignKey> getForeignKeysIntern(java.lang.String pCatalog,
                                                          java.lang.String pSchema,
                                                          java.lang.String pTable)
                                                   throws DataSourceException
Returns all Foreign Keys for the specified table.

Overrides:
getForeignKeysIntern in class DBAccess
Parameters:
pCatalog - the catalog to use
pSchema - the schema to use
pTable - the table to use as base table.
Returns:
all Foreign Keys for the specified table.
Throws:
DataSourceException - if an error occur in determining the ForeignKeys.

commitOrRollbackBeforeClose

protected void commitOrRollbackBeforeClose()
Calls commit or rollback before closing the connection.

Overrides:
commitOrRollbackBeforeClose in class DBAccess

insertHana

protected java.lang.Object[] insertHana(java.lang.String pWriteBackTable,
                                        java.lang.String pInsertStatement,
                                        ServerMetaData pServerMetaData,
                                        java.lang.Object[] pNewDataRow,
                                        java.lang.String pDummyColumn)
                                 throws DataSourceException
Returns the newly inserted row from a SAP Hana Database.
It gets the next value for all autogenerated Columns and sets them manually.

Parameters:
pWriteBackTable - the table to use for the insert
pInsertStatement - the SQL Statement to use for the insert
pServerMetaData - the meta data to use.
pNewDataRow - the new row (Object[]) with the values to insert
pDummyColumn - true, if all writeable columns are null, but for a correct INSERT it have to be minimum one column to use in the syntax.
Returns:
the newly inserted row from a Ansi SQL Database.
Throws:
DataSourceException - if an Exception occur during insert to the storage


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.