com.sibvisions.rad.persist.jdbc
Class DBStorage

java.lang.Object
  extended by com.sibvisions.rad.persist.AbstractStorage
      extended by com.sibvisions.rad.persist.AbstractCachedStorage
          extended by com.sibvisions.rad.persist.jdbc.DBStorage
All Implemented Interfaces:
ICachedStorage, IStorage, INamedObject

public class DBStorage
extends AbstractCachedStorage

The DBStorage is a IStorage for SQL database specific features.

The DBStorage allows to influence the creation of the SELECT statement to get the data.
The following template shows how the SELECT will be constructed out of the specified properties.

 
 SELECT getBeforeQueryColumns() getQueryColumns()
 FROM   getFromClause()
 WHERE  getFilter()
 AND    getMasterReference()
 AND    getWhereClause()
 getAfterWhereClause()
 ORDER BY getSort()
 
 
Example:
  
 SELECT DISTINCT // ++ comment, optimizer hints 
        a.COL1 C, b.COL2 D, a.FK_ID FK_ID, ...
 FROM   TABLE1 a,
        TABLE2 b,
        ...
 WHERE  C LIKE 'a%' AND D IS NOT NULL ... // getFilter().getSQL
 AND    FK_ID = 23                        // getMasterReference() get all detail rows to a 
                                             specific master row in an other DataBook
 AND    a.ID = b.FK_ID ...                // getLastWhereCondition() * GROUP BY C, D                            // getAfterWhereClause()
 ORDER BY C DESC                                                        // getSort()
 
 

See Also:
IStorage, ColumnMetaData, RemoteDataBook, DBAccess

Constructor Summary
DBStorage()
          Constructs a DBStorage.
 
Method Summary
 void close()
          It close the DBStorage.
protected  void createAutomaticLinkReference(ServerMetaData pMetaData, String[] pColumns, AbstractStorage pDBStorage, String[] pReferenceColumns)
          Creates and sets a new StorageReferenceDefinition with the specified DBStorage and columns and reference columns on all pColumns.
 void createAutomaticLinkReference(String[] pColumns, DBStorage pDBStorage, String[] pReferenceColumns)
          Creates and sets a new StorageReferenceDefinition with the specified DBStorage and columns and reference columns on all pColumns.
 void createAutomaticLinkReference(String[] pColumns, String pFromClause, String[] pReferenceColumns)
          Creates and sets a new StorageReferenceDefinition with the specified FromClause and columns and reference columns on all pColumns.
protected  DBStorage createAutomaticLinkStorage(String pFrom)
          Creates a new DBStorage which is configured for automatic link cell editors.
protected  Object createCheckSum(Object... pObjects)
          Creates a MD5 checksum with given objects.
 void executeDelete(Object[] pDeleteDataRow)
          This method has to be implemented in the Storage implementation and should have the functionality of the delete method.
 List<Object[]> executeFetch(ICondition pFilter, SortDefinition pSort, int pFromRow, int pMinimumRowCount)
          This method has to be implemented in the Storage implementation and should have the functionality of the fetch method.
 MetaData executeGetMetaData()
          This method has to be implemented in the Storage implementation and should have the functionality of the getMetaData method.
 Object[] executeInsert(Object[] pDataRow)
          This method has to be implemented in the Storage implementation and should have the functionality of the insert method.
 Object[] executeRefetchRow(Object[] pDataRow)
          This method has to be implemented in the Storage implementation and should have the functionality of the refetchRow method.
 Object[] executeUpdate(Object[] pOldDataRow, Object[] pNewDataRow)
          This method has to be implemented in the Storage implementation and should have the functionality of the update method.
 String getAfterWhereClause()
          Returns the string to place in the SELECT statement after the WHERE clause and before the ORDER BY clause.
 String getBeforeQueryColumns()
          Returns the string to place in the SELECT statement between the SELECT and the first query column.
 String[] getColumnNames()
          Gets an array of column names as defined in the metadata.
 IDBAccess getDBAccess()
          Returns the IDBAccess of this DBStorage .
 SortDefinition getDefaultSort()
          Returns the default sort.
 int getEstimatedRowCount(ICondition pFilter)
          Returns the number of rows in this AbstractStorage from the storage.
 String getFromClause()
          Returns the query tables to use in the SELECT statement to get the data from the storage.
 MetaData getMetaData(String pGroup, String pName)
          Returns the meta data for this AbstractStorage from the storage as MetaData and places the MetaData to the cache with a group name and meta data name.
 String[] getQueryColumns()
          Returns the query columns of the SELECT statement.
 ICondition getRestrictCondition()
          Returns the restrict condition.
 Map<String,IStorage> getSubStorages()
          Gets all known sub storages as key / value pair.
 String getWhereClause()
          Returns the string to place in the SELECT statement after the last WHERE condition from the Filter or MasterReference (Master-Detail Condition).
 String[] getWritebackColumns()
          Returns the list of write back columns to use in the INSERT, UPDATE statements.
 String getWritebackTable()
          Returns the WritebackTable, which is used for the INSERT, UPDATE, DELETE calls.
protected  String getWritebackTableCatalog()
          Gets the catalog name of the writeback table.
protected  String getWritebackTableSchema()
          Gets the schema name of the writeback table.
protected  boolean hasLinkReference(ServerMetaData pMetaData, String pColumnName)
          Gets whether a column has a link reference set.
 boolean hasLinkReference(String pColumnName)
          Gets whether a column has a link reference set.
 boolean isAllowedValues()
          Returns the allowed value detection mode.
 boolean isAutoLinkReference()
          Returns if the automatic LinkReference mode is on or off.
 boolean isDefaultAllowedValues()
          Returns the default allowed value detection mode.
static boolean isDefaultAutoLinkReference()
          Returns the default automatic LinkReference mode.
static boolean isDefaultDefaultValue()
          Returns the default - default value detection mode.
 boolean isDefaultValue()
          Returns the default value detection mode.
 boolean isOpen()
          Returns if the DBStorage is open.
 boolean isRefetch()
          Returns if this DBStorage refetchs after insert and update.
 void open()
          Opens the DBStorage and checks if the DBAssess is !
protected  void openInternal(boolean pUseRepresentationColumnsAsQueryColumns)
          Opens the DBStorage and checks if the DBAccess is !
protected  Object[] refetchRow(Object[] pDataRow, boolean pLock)
          Refetch and optional locks the specified DataRow via PK.
protected  void refreshMetaData()
          Refreshs the MetaData with initial settings.
 void removeLinkReference(String pColumnName)
          Removes the link reference for an server side Dropdown list (automatic linked celleditor).
 void setAfterWhereClause(String pAfterWhereClause)
          Sets the string to place in the SELECT statement after the WHERE clause and before the ORDER BY clause.
 void setAllowedValues(boolean pAllowedValues)
          Sets the allowed value detection en- or disabled.
 void setAutoLinkReference(boolean pAutoLinkReference)
          Sets if the automatic link reference detection is en- or disabled.
 void setBeforeQueryColumns(String pBeforeQueryColumns)
          Sets the string to place in the SELECT statement between the SELECT and the first query column.
 void setDBAccess(IDBAccess pDBAccess)
          Set the IDBAccess of this DBStorage .
static void setDefaultAllowedValues(boolean pAllowedValues)
          Sets the default allowed value detection en- or disabled.
static void setDefaultAutoLinkReference(boolean pDefaultAutoLinkReference)
          Sets the default automatic link reference detection mode.
static void setDefaultDefaultValue(boolean pDefaultValue)
          Sets the default - default value detection en- or disabled.
 void setDefaultSort(SortDefinition pDefaultSort)
          Sets the default sort.
 void setDefaultValue(boolean pDefaultValue)
          Sets the default value detection en- or disabled.
 void setFromClause(String pFromClause)
          Sets the query tables to use in the SELECT statement to get the data from the storage.
 void setQueryColumns(String[] pQueryColumns)
          Sets the query columns of the SELECT statement.
 void setRefetch(boolean pRefetch)
          Sets if this DBStorage refetchs after insert and update.
 void setRestrictCondition(ICondition pRestrictCondition)
          Sets the restrict condition.
 void setWhereClause(String pWhereClause)
          Sets the string to place in the SELECT statement after the last WHERE condition from the Filter or MasterReference (Master-Detail Condition).
 void setWritebackColumns(String[] pWritebackColumns)
          Sets the list of write back columns to use in the INSERT, UPDATE statements.
 void setWritebackTable(String pWritebackTable)
          Sets the WritebackTable, which is used for the INSERT, UPDATE, DELETE calls.
 String toString()
          
 void writeCSV(OutputStream pOutputStream, String[] pColumnNames, String[] pLabels, ICondition pFilter, SortDefinition pSort, String pSeparator)
          Write the current storage with the specified filter and sort into the given output stream as CSV Format.
 
Methods inherited from class com.sibvisions.rad.persist.AbstractCachedStorage
clearMetaData, clearMetaData, getMetaData, getMetaDataCacheOption, getMetaDataFromCache, getMetaDataFromCache, isGlobalMetaDataCacheEnabled, isMetaDataCacheEnabled, putMetaDataToCache, removeMetaData, setGlobalMetaDataCacheEnabled, setMetaDataCacheOption
 
Methods inherited from class com.sibvisions.rad.persist.AbstractStorage
createBean, createBeanType, createCSV, createCSV, createCSV, createEmptyBean, createPOJO, createPOJO, debug, delete, delete, error, eventAfterDelete, eventAfterInsert, eventAfterUpdate, eventBeforeDelete, eventBeforeInsert, eventBeforeUpdate, eventCalculateRow, executeDeleteAsBean, executeFetchAsBean, executeInsertAsBean, executeRefetchRowAsBean, executeUpdateAsBean, fetch, fetch, fetch, fetchBean, fetchBean, getAndInitBeanType, getMetaData, getName, info, insert, insert, refetch, refetchRow, setName, setPropertyNameForColumn, update, update, updateBean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.persist.IStorage
delete, fetch, getMetaData, insert, refetchRow, update
 

Constructor Detail

DBStorage

public DBStorage()
Constructs a DBStorage.

Method Detail

writeCSV

public void writeCSV(OutputStream pOutputStream,
                     String[] pColumnNames,
                     String[] pLabels,
                     ICondition pFilter,
                     SortDefinition pSort,
                     String pSeparator)
              throws Exception
Write the current storage with the specified filter and sort into the given output stream as CSV Format.

Specified by:
writeCSV in class AbstractStorage
Parameters:
pOutputStream - the output stream to use for the CSV stream
pColumnNames - the column names to include in the export
pLabels - the labels to show as header in the export
pFilter - the condition
pSort - the sort definition
pSeparator - the column separator
Throws:
Exception - if the CSV output couldn't written to stream

executeGetMetaData

public MetaData executeGetMetaData()
                            throws DataSourceException
This method has to be implemented in the Storage implementation and should have the functionality of the getMetaData method.

Specified by:
executeGetMetaData in class AbstractStorage
Returns:
the MetaData
Throws:
DataSourceException - if an Exception occur during getting the meta data from the storage
See Also:
IStorage.getMetaData()

getEstimatedRowCount

public int getEstimatedRowCount(ICondition pFilter)
                         throws DataSourceException
Returns the number of rows in this AbstractStorage from the storage.
It consider the specified ICondition to count the rows.

Parameters:
pFilter - the ICondition to use.
Returns:
the number of rows in this AbstractStorage from the storage.
Throws:
DataSourceException - if an Exception occur during interacting with the storage.

executeFetch

public List<Object[]> executeFetch(ICondition pFilter,
                                   SortDefinition pSort,
                                   int pFromRow,
                                   int pMinimumRowCount)
                            throws DataSourceException
This method has to be implemented in the Storage implementation and should have the functionality of the fetch method.

Specified by:
executeFetch in class AbstractStorage
Parameters:
pFilter - the ICondition to use.
pSort - the SortDefinition to use.
pFromRow - the from row index to request from storage.
pMinimumRowCount - the minimum row count to request, beginning from the pFromRow.
Returns:
the requested rows as List[Object[]].
Throws:
DataSourceException - if an Exception occur during interacting with the storage.
See Also:
IStorage.fetch(ICondition, SortDefinition, int, int)

executeRefetchRow

public Object[] executeRefetchRow(Object[] pDataRow)
                           throws DataSourceException
This method has to be implemented in the Storage implementation and should have the functionality of the refetchRow method.

Specified by:
executeRefetchRow in class AbstractStorage
Parameters:
pDataRow - the specified row as Object[].
Returns:
the refetched row as Object[].
Throws:
DataSourceException - if an Exception occur during interacting with the storage.
See Also:
IStorage.refetchRow(Object[])

executeInsert

public Object[] executeInsert(Object[] pDataRow)
                       throws DataSourceException
This method has to be implemented in the Storage implementation and should have the functionality of the insert method.

Specified by:
executeInsert in class AbstractStorage
Parameters:
pDataRow - the new row as Object[] to insert.
Returns:
the newly inserted row from this IStorage.
Throws:
DataSourceException - if an Exception occur during insert the row to the storage
See Also:
IStorage.insert(Object[])

executeUpdate

public Object[] executeUpdate(Object[] pOldDataRow,
                              Object[] pNewDataRow)
                       throws DataSourceException
This method has to be implemented in the Storage implementation and should have the functionality of the update method.

Specified by:
executeUpdate in class AbstractStorage
Parameters:
pOldDataRow - the old row as Object[]
pNewDataRow - the new row as Object[] to update
Returns:
the updated row as Object[].
Throws:
DataSourceException - if an Exception occur during updating the row.
See Also:
IStorage.update(Object[], Object[])

executeDelete

public void executeDelete(Object[] pDeleteDataRow)
                   throws DataSourceException
This method has to be implemented in the Storage implementation and should have the functionality of the delete method.

Specified by:
executeDelete in class AbstractStorage
Parameters:
pDeleteDataRow - the row as Object[] to delete.
Throws:
DataSourceException - if an Exception occur during deleting the row or if the storage isn't opened or the PrimaryKey is wrong and more/less then one row is deleted.
See Also:
IStorage.delete(Object[])

toString

public String toString()

Overrides:
toString in class Object

getMetaData

public MetaData getMetaData(String pGroup,
                            String pName)
                     throws DataSourceException
Returns the meta data for this AbstractStorage from the storage as MetaData and places the MetaData to the cache with a group name and meta data name.

Specified by:
getMetaData in interface ICachedStorage
Overrides:
getMetaData in class AbstractCachedStorage
Parameters:
pGroup - the cache group name
pName - the name for the meta data in the cache group
Returns:
the meta data for this AbstractStorage from the storage as MetaData.
Throws:
DataSourceException - if an Exception occur during getting the meta data from the storage

open

public void open()
          throws DataSourceException
Opens the DBStorage and checks if the DBAssess is != null. If automatic link celleditors are used, then the implicit link DBStorge objects are put with "detailtablename" as sub storage.

Throws:
DataSourceException - if the DBAccess is null.

openInternal

protected void openInternal(boolean pUseRepresentationColumnsAsQueryColumns)
                     throws DataSourceException
Opens the DBStorage and checks if the DBAccess is != null. It doesn't cache the MetaData!

Parameters:
pUseRepresentationColumnsAsQueryColumns - yes if the QueryColumns are set with all representation columns including the Primary Key columns.
Throws:
DataSourceException - if the DBAccess is null.

refreshMetaData

protected void refreshMetaData()
                        throws DataSourceException
Refreshs the MetaData with initial settings.

Throws:
DataSourceException - if the DBAccess is null.

createAutomaticLinkReference

public void createAutomaticLinkReference(String[] pColumns,
                                         String pFromClause,
                                         String[] pReferenceColumns)
                                  throws ModelException
Creates and sets a new StorageReferenceDefinition with the specified FromClause and columns and reference columns on all pColumns. e.g. its used to make an automatic linked celleditor from a custom written view and set it on all pColumns.

Parameters:
pColumns - the columns to use.
pFromClause - the FromClause. e.g. VIEW name.
pReferenceColumns - the reference columns to use.
Throws:
ModelException - if the StorageReferenceDefinition couldn't created.

createAutomaticLinkReference

public void createAutomaticLinkReference(String[] pColumns,
                                         DBStorage pDBStorage,
                                         String[] pReferenceColumns)
                                  throws ModelException
Creates and sets a new StorageReferenceDefinition with the specified DBStorage and columns and reference columns on all pColumns.

Parameters:
pColumns - the columns to use.
pDBStorage - the DBStorage to use.
pReferenceColumns - the reference columns to use.
Throws:
ModelException - if the StorageReferenceDefinition couldn't created.

createAutomaticLinkReference

protected void createAutomaticLinkReference(ServerMetaData pMetaData,
                                            String[] pColumns,
                                            AbstractStorage pDBStorage,
                                            String[] pReferenceColumns)
                                     throws ModelException
Creates and sets a new StorageReferenceDefinition with the specified DBStorage and columns and reference columns on all pColumns.

Parameters:
pMetaData - the metadata to use.
pColumns - the columns to use.
pDBStorage - the DBStorage to use.
pReferenceColumns - the reference columns to use.
Throws:
ModelException - if the StorageReferenceDefinition couldn't created.

removeLinkReference

public void removeLinkReference(String pColumnName)
                         throws ModelException
Removes the link reference for an server side Dropdown list (automatic linked celleditor). If its automatic created, its sub DBStorage is also removed.

Parameters:
pColumnName - the column name to use, where the link reference will be removed
Throws:
ModelException - if the column doesn't exist.

hasLinkReference

public boolean hasLinkReference(String pColumnName)
                         throws ModelException
Gets whether a column has a link reference set.

Parameters:
pColumnName - the column name
Returns:
true if a link reference is set, false otherwise
Throws:
ModelException - if the column doesn't exist.

hasLinkReference

protected boolean hasLinkReference(ServerMetaData pMetaData,
                                   String pColumnName)
                            throws ModelException
Gets whether a column has a link reference set.

Parameters:
pMetaData - the metadata to use
pColumnName - the column name
Returns:
true if a link reference is set, false otherwise
Throws:
ModelException - if the column doesn't exist.

isOpen

public boolean isOpen()
Returns if the DBStorage is open.

Returns:
true if the DBStorage is open.

close

public void close()
It close the DBStorage.


setDBAccess

public void setDBAccess(IDBAccess pDBAccess)
Set the IDBAccess of this DBStorage .

Parameters:
pDBAccess - the IDBAccess of this DBStorage .

getDBAccess

public IDBAccess getDBAccess()
Returns the IDBAccess of this DBStorage .

Returns:
the IDBAccess of this DBStorage .

getFromClause

public String getFromClause()
Returns the query tables to use in the SELECT statement to get the data from the storage.

Returns:
the query tables to use in the SELECT statement to get the data from the storage.

setFromClause

public void setFromClause(String pFromClause)
Sets the query tables to use in the SELECT statement to get the data from the storage.

Parameters:
pFromClause - the queryTables to set.

getQueryColumns

public String[] getQueryColumns()
Returns the query columns of the SELECT statement.

Returns:
the query columns of the SELECT statement.

setQueryColumns

public void setQueryColumns(String[] pQueryColumns)
Sets the query columns of the SELECT statement.

Parameters:
pQueryColumns - the queryColumns to set

getBeforeQueryColumns

public String getBeforeQueryColumns()
Returns the string to place in the SELECT statement between the SELECT and the first query column.

Returns:
the string to place in the SELECT statement between the SELECT and the first query column.

setBeforeQueryColumns

public void setBeforeQueryColumns(String pBeforeQueryColumns)
Sets the string to place in the SELECT statement between the SELECT and the first query column.

Parameters:
pBeforeQueryColumns - the beforeQueryColumns to set

getWhereClause

public String getWhereClause()
Returns the string to place in the SELECT statement after the last WHERE condition from the Filter or MasterReference (Master-Detail Condition).

Returns:
the string to place in the SELECT statement after the last WHERE condition from the Filter or MasterReference (Master-Detail Condition).

setWhereClause

public void setWhereClause(String pWhereClause)
Sets the string to place in the SELECT statement after the last WHERE condition from the Filter or MasterReference (Master-Detail Condition).

Parameters:
pWhereClause - the last Where Condition to set

getAfterWhereClause

public String getAfterWhereClause()
Returns the string to place in the SELECT statement after the WHERE clause and before the ORDER BY clause.

Returns:
the string to place in the SELECT statement after the WHERE clause and before the ORDER BY clause.

setAfterWhereClause

public void setAfterWhereClause(String pAfterWhereClause)
Sets the string to place in the SELECT statement after the WHERE clause and before the ORDER BY clause. e.g. GROUP BY a, HAVING ...

Parameters:
pAfterWhereClause - the afterWhereClause to set

getWritebackColumns

public String[] getWritebackColumns()
Returns the list of write back columns to use in the INSERT, UPDATE statements.

Returns:
the saWritebackColumns.

setWritebackColumns

public void setWritebackColumns(String[] pWritebackColumns)
Sets the list of write back columns to use in the INSERT, UPDATE statements.

Parameters:
pWritebackColumns - the pWritebackColumns to set

getWritebackTable

public String getWritebackTable()
Returns the WritebackTable, which is used for the INSERT, UPDATE, DELETE calls.

Returns:
the sWritebackTable.

setWritebackTable

public void setWritebackTable(String pWritebackTable)
Sets the WritebackTable, which is used for the INSERT, UPDATE, DELETE calls.

Parameters:
pWritebackTable - the pWritebackTable to set

getDefaultSort

public SortDefinition getDefaultSort()
Returns the default sort. It is used, if no other sort is defined.

Returns:
the default sort.

setDefaultSort

public void setDefaultSort(SortDefinition pDefaultSort)
Sets the default sort. It is used, if no other sort is defined.

Parameters:
pDefaultSort - the default sort.

getRestrictCondition

public ICondition getRestrictCondition()
Returns the restrict condition. It is always added with And to any given condition.

Returns:
the restrict condition.

setRestrictCondition

public void setRestrictCondition(ICondition pRestrictCondition)
Sets the restrict condition. It is always added with And to any given condition.

Parameters:
pRestrictCondition - the restrict condition.

isRefetch

public boolean isRefetch()
Returns if this DBStorage refetchs after insert and update.

Returns:
if this DBStorage refetchs after insert and update.

setRefetch

public void setRefetch(boolean pRefetch)
Sets if this DBStorage refetchs after insert and update.

Parameters:
pRefetch - true if this DBStorage refetchs after insert and update.

setAutoLinkReference

public void setAutoLinkReference(boolean pAutoLinkReference)
Sets if the automatic link reference detection is en- or disabled. The automatic link reference is defined through a foreign key reference in the database.

Parameters:
pAutoLinkReference - true if the automatic LinkReference mode is on, false to disable auto link reference mode

isAutoLinkReference

public boolean isAutoLinkReference()
Returns if the automatic LinkReference mode is on or off.

Returns:
trueif the automatic LinkReference mode is on, otherwise false
See Also:
setAutoLinkReference(boolean)

setDefaultAutoLinkReference

public static void setDefaultAutoLinkReference(boolean pDefaultAutoLinkReference)
Sets the default automatic link reference detection mode. The automatic link reference is defined through a foreign key reference in the database.

Parameters:
pDefaultAutoLinkReference - the default automatic LinkReference mode to use.

isDefaultAutoLinkReference

public static boolean isDefaultAutoLinkReference()
Returns the default automatic LinkReference mode.

Returns:
the default automatic LinkReference mode.
See Also:
setDefaultAutoLinkReference(boolean)

setDefaultValue

public void setDefaultValue(boolean pDefaultValue)
Sets the default value detection en- or disabled. The default value is a default value for a column in the database

Parameters:
pDefaultValue - true to enable the default value detection

isDefaultValue

public boolean isDefaultValue()
Returns the default value detection mode.

Returns:
true if the default value detection is enabled, false otherwise
See Also:
setDefaultValue(boolean)

setDefaultDefaultValue

public static void setDefaultDefaultValue(boolean pDefaultValue)
Sets the default - default value detection en- or disabled. The default value is a default value for a column in the database.

Parameters:
pDefaultValue - true to enable the default - default value detection

isDefaultDefaultValue

public static boolean isDefaultDefaultValue()
Returns the default - default value detection mode.

Returns:
true if the default - default value detection is enabled, false otherwise
See Also:
setDefaultDefaultValue(boolean)

setAllowedValues

public void setAllowedValues(boolean pAllowedValues)
Sets the allowed value detection en- or disabled. An allowed value is defined in the database through check constraints.

Parameters:
pAllowedValues - true to enable the allowed value detection, false otherwise

isAllowedValues

public boolean isAllowedValues()
Returns the allowed value detection mode.

Returns:
true if the allowed value detection is enabled, false otherwise
See Also:
setAllowedValues(boolean)

setDefaultAllowedValues

public static void setDefaultAllowedValues(boolean pAllowedValues)
Sets the default allowed value detection en- or disabled. An allowed value is defined in the database through check constraints.

Parameters:
pAllowedValues - true to enable the default allowed value detection, false otherwise

isDefaultAllowedValues

public boolean isDefaultAllowedValues()
Returns the default allowed value detection mode.

Returns:
true if the default allowed value detection is enabled, false otherwise
See Also:
setDefaultAllowedValues(boolean)

getWritebackTableCatalog

protected String getWritebackTableCatalog()
Gets the catalog name of the writeback table.

Returns:
the detected catalog name or null if no writeback table is set

getWritebackTableSchema

protected String getWritebackTableSchema()
Gets the schema name of the writeback table.

Returns:
the detected schema name or null if no writeback table is set

refetchRow

protected Object[] refetchRow(Object[] pDataRow,
                              boolean pLock)
                       throws DataSourceException
Refetch and optional locks the specified DataRow via PK.

Parameters:
pDataRow - the DataRow to refetch
pLock - true if the row is locked before.
Returns:
the refetched DataRow
Throws:
DataSourceException - if the refetch fails

getColumnNames

public String[] getColumnNames()
Gets an array of column names as defined in the metadata.

Returns:
the column names as array
See Also:
AbstractStorage.getMetaData()

getSubStorages

public Map<String,IStorage> getSubStorages()
Gets all known sub storages as key / value pair.

Returns:
the key / value pair with subtablename and substorage or null if no substorages are known

createAutomaticLinkStorage

protected DBStorage createAutomaticLinkStorage(String pFrom)
                                        throws DataSourceException
Creates a new DBStorage which is configured for automatic link cell editors. The auto link reference feature is disabled for this storage.

Parameters:
pFrom - The from clause
Returns:
the newly created storage
Throws:
DataSourceException - if the from clause causes errors or the metadata are not available

createCheckSum

protected Object createCheckSum(Object... pObjects)
Creates a MD5 checksum with given objects.

Parameters:
pObjects - the objects for the checksum calculation
Returns:
the MD5 checksum


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.