jACOB 2.7 API Documentation.

de.tif.jacob.core.data
Interface IDataAccessor


public interface IDataAccessor

A data accessor is the central "entry point" for accessing data from data sources. Each data accessor instance provides caching of data which has been retrieved by one of the searches methods provided by IDataTable or IDataBrowser.


Method Summary
 void clear()
          Performs a complete reset of this data accessor including all underlying IDataTable and IDataBrowser instances.
 IDataTableRecord cloneRecord(IDataTransaction trans, IDataTableRecord recordToClone)
          Same behaviour than cloneRecord(IDataTransaction, IDataTableRecord, ITableAlias) except that the alias to clone the record for equals to the related alias of recordToClone.
 IDataTableRecord cloneRecord(IDataTransaction trans, IDataTableRecord recordToClone, ITableAlias alias)
          Clones the given table record, i.e. create a new table record for the specified table alias and copies the field values from the record to clone to the new record.
 IDataTableRecord cloneRecord(IDataTransaction trans, IDataTableRecord recordToClone, java.lang.String aliasName)
          Same behaviour than cloneRecord(IDataTransaction, IDataTableRecord, ITableAlias) except that the alias to clone the record for is specified by name.
 IDataBrowser createBrowser(IAdhocBrowserDefinition adhocBrowserDefinition)
          Creates a new data browser for the given adhoc browser definition.
 IApplicationDefinition getApplication()
          Returns the application definition used for this accessor.
 IDataBrowser getBrowser(IBrowserDefinition browserDefinition)
          Gets the data browser of the given browser definition.
 IDataBrowser getBrowser(java.lang.String name)
          Gets the data browser specified by name.
 IDataTable getTable(ITableAlias alias)
          Gets the data table of the given table alias.
 IDataTable getTable(java.lang.String name)
          Gets the data table specified by name.
 IDataAccessor newAccessor()
          Creates a new data accessor instance.
 IDataTransaction newTransaction()
          Creates a new data transaction.
 boolean propagateRecord(IDataRecord record, Filldirection filldirection)
          Propagates the given record, i.e.
 boolean propagateRecord(IDataRecord record, IRelationSet relationSet, Filldirection filldirection)
          Propagates the given record, i.e.
 boolean propagateRecord(IDataRecord record, java.lang.String relationSetName, Filldirection filldirection)
          Propagates the given record, i.e.
 void qbeClearAll()
          Performs a complete reset of all QBE constraints of any underlying IDataTableinstance.
 boolean qbeHasConstraint(ITableAlias alias, IRelationSet relationSet)
          Checks whether any constraint exists for the given table alias and all related table aliases specified by the given relation set.
 boolean qbeHasConstraint(java.lang.String aliasName, java.lang.String relationSetName)
          Checks whether any constraint exists for the given table alias and all related table aliases specified by the given relation set.
 

Method Detail

clear

void clear()
Performs a complete reset of this data accessor including all underlying IDataTable and IDataBrowser instances. This includes clearing all QBE constraints, all cached records and any record selections.

See Also:
IDataTable.qbeClear(), IDataRecordSet.clear()

qbeClearAll

void qbeClearAll()
Performs a complete reset of all QBE constraints of any underlying IDataTableinstance.

See Also:
IDataTable.qbeClear()

qbeHasConstraint

boolean qbeHasConstraint(ITableAlias alias,
                         IRelationSet relationSet)
Checks whether any constraint exists for the given table alias and all related table aliases specified by the given relation set.

Parameters:
alias - the table alias to check for constraints and used as starting point for related table aliases.
relationSet - the relation set to check for constraints.
Returns:
true if at least one constraint exists, otherwise false.

qbeHasConstraint

boolean qbeHasConstraint(java.lang.String aliasName,
                         java.lang.String relationSetName)
Checks whether any constraint exists for the given table alias and all related table aliases specified by the given relation set.

This method is equivalent to qbeHasConstraint(ITableAlias, IRelationSet) except that table alias and relation set are specified by name.

Parameters:
aliasName - the name of the table alias to check for constraints and used as starting point for related table aliases.
relationSetName - the name of the relation set to check for constraints.
Returns:
true if at least one constraint exists, otherwise false.

createBrowser

IDataBrowser createBrowser(IAdhocBrowserDefinition adhocBrowserDefinition)
Creates a new data browser for the given adhoc browser definition.

Note: The returned data browser is not cleared when clear() is performed.

Parameters:
adhocBrowserDefinition - the adhoc browser definition
Returns:
the newly created data browser
See Also:
IApplicationDefinition.createAdhocBrowserDefinition(IBrowserDefinition), IApplicationDefinition.createAdhocBrowserDefinition(ITableAlias)

getBrowser

IDataBrowser getBrowser(IBrowserDefinition browserDefinition)
                        throws java.lang.RuntimeException
Gets the data browser of the given browser definition.

Parameters:
browserDefinition - the browser definition
Returns:
the desired data browser
Throws:
java.lang.RuntimeException - if the given browser definition is a IAdhocBrowserDefinition

getBrowser

IDataBrowser getBrowser(java.lang.String name)
                        throws java.lang.RuntimeException
Gets the data browser specified by name.

The name of the data browser is equivalent to the name of the underlying IBrowserDefinition.

Parameters:
name - the name of data browser
Returns:
the desired data browser
Throws:
java.lang.RuntimeException - if no data browser with the given name exists

getTable

IDataTable getTable(java.lang.String name)
                    throws java.lang.RuntimeException
Gets the data table specified by name.

The name of the data table is equivalent to the name of the underlying ITableAlias.

Parameters:
name - the name of the data table.
Returns:
the desired data table
Throws:
java.lang.RuntimeException - if no data table with the given name exists

getTable

IDataTable getTable(ITableAlias alias)
Gets the data table of the given table alias.

Parameters:
alias - the table alias
Returns:
the desired data table

newAccessor

IDataAccessor newAccessor()
Creates a new data accessor instance.

Returns:
the new accessor instance.

newTransaction

IDataTransaction newTransaction()
Creates a new data transaction.

Returns:
the new transaction.

getApplication

IApplicationDefinition getApplication()
Returns the application definition used for this accessor.

Returns:
the application definition.

propagateRecord

boolean propagateRecord(IDataRecord record,
                        Filldirection filldirection)
                        throws RecordNotFoundException
Propagates the given record, i.e. "refreshes" the record itself and all records which are linked to each other by means of any defined relation. The fill direction determines in which direction(s) the propagation should be processed. The starting point of the propagation is always the given record.

Note: This method has identical behaviour than calling propagateRecord(IDataRecord, IRelationSet, Filldirection) in case the relation set is the default relation set.

Parameters:
record - the record to propagate
filldirection - the fill direction to propagate
Returns:
true if the propagation had been successful, false if the given record could not be propagate, because a primary key is missing
Throws:
RecordNotFoundException - If the given record could not be reloaded from the database.

propagateRecord

boolean propagateRecord(IDataRecord record,
                        IRelationSet relationSet,
                        Filldirection filldirection)
                        throws RecordNotFoundException
Propagates the given record, i.e. "refreshes" the record itself and all records which are linked to each other by means of relations contained in the specified relation set. The fill direction determines in which direction(s) the propagation should be processed. The starting point of the propagation is always the given record.

Parameters:
record - the record to propagate
relationSet - the relation set to propagate
filldirection - the fill direction to propagate
Returns:
true if the propagation had been successful, false if the given record could not be propagate, because a primary key is missing
Throws:
RecordNotFoundException - If the given record could not be reloaded from the database.

propagateRecord

boolean propagateRecord(IDataRecord record,
                        java.lang.String relationSetName,
                        Filldirection filldirection)
                        throws RecordNotFoundException
Propagates the given record, i.e. "refreshes" the record itself and all records which are linked to each other by means of relations contained in the specified relation set. The fill direction determines in which direction(s) the propagation should be processed. The starting point of the propagation is always the given record.

Parameters:
record - the record to propagate
relationSetName - the name of the relation set to propagate
filldirection - the fill direction to propagate
Returns:
true if the propagation had been successful, false if the given record could not be propagate, because a primary key is missing
Throws:
RecordNotFoundException - If the given record could not be reloaded from the database.

cloneRecord

IDataTableRecord cloneRecord(IDataTransaction trans,
                             IDataTableRecord recordToClone)
Same behaviour than cloneRecord(IDataTransaction, IDataTableRecord, ITableAlias) except that the alias to clone the record for equals to the related alias of recordToClone.

Parameters:
trans - the transaction in which context this operation should be executed
recordToClone - the record to clone
Returns:
the new/cloned record

cloneRecord

IDataTableRecord cloneRecord(IDataTransaction trans,
                             IDataTableRecord recordToClone,
                             java.lang.String aliasName)
Same behaviour than cloneRecord(IDataTransaction, IDataTableRecord, ITableAlias) except that the alias to clone the record for is specified by name.

Parameters:
trans - the transaction in which context this operation should be executed
recordToClone - the record to clone
aliasName - the name of the table alias to clone the record for, which must point to the same physical table than the related alias of recordToClone!
Returns:
the new/cloned record

cloneRecord

IDataTableRecord cloneRecord(IDataTransaction trans,
                             IDataTableRecord recordToClone,
                             ITableAlias alias)
Clones the given table record, i.e. create a new table record for the specified table alias and copies the field values from the record to clone to the new record.

After this method has been called the returned record becomes the selected record of the data table referenced by alias of this accessor. Hence, previously populated records of that data table will be cleared!

Call IDataTransaction.commit() to save this record to the data source.

Note: The values of the primary key and the history field (see ITableDefinition.getHistoryField(), if existing, are not copied!

Parameters:
trans - the transaction in which context this operation should be executed
recordToClone - the record to clone
alias - the table alias to clone the record for, which must point to the same physical table than the related alias of recordToClone!
Returns:
the new/cloned record
See Also:
IDataTable.getSelectedRecord()

jACOB 2.7 API Documentation.