public interface DataSource
The DataSource is a programming interface to Web Central data access layer. Web Central data access layer implements declarative object-relational mapping, secure data access, and transparent data localization using metadata defined in the ARCHIBUS data dictionary.
When the DataSource is used to read or write data, it transparently performs ARCHIBUS-specific processing:
Applies ARCHIBUS security: checks whether the current user has read/write permissions for fields;
Applies current user VPA restrictions (if they are applicable to the query table/fields);
For tables with localized fields, chooses field according to the current user locale;
Converts data values from database-specific formats to Java objects and back;
Generates SQL queries using database-specific SQL dialect.
Handles transactions and exceptions, maps database-specific exceptions to ARCHIBUS user-friendly exceptions.
Optionally formats data values for the current user locale.
Modifier and Type | Interface and Description |
---|---|
static interface |
DataSource.RecordHandler
Callback interface that can be passed as a parameter to getRecords() and getAllRecords().
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATA_TYPE_BOOLEAN
Constant for unformatted (verbatim) parameter type.
|
static java.lang.String |
DATA_TYPE_CURRENCY
Constant for currency type.
|
static java.lang.String |
DATA_TYPE_DATE
Constant for date field/parameter type.
|
static java.lang.String |
DATA_TYPE_DOUBLE
Constant for numeric field/parameter type.
|
static java.lang.String |
DATA_TYPE_INTEGER
Constant for integer field/parameter type.
|
static java.lang.String |
DATA_TYPE_MEMO
Constant for memo field/parameter type.
|
static java.lang.String |
DATA_TYPE_NUMBER
Constant for numeric field/parameter type.
|
static java.lang.String |
DATA_TYPE_TEXT
Constant for text field/parameter type.
|
static java.lang.String |
DATA_TYPE_TIME
Constant for time field/parameter type.
|
static java.lang.String |
DATA_TYPE_VERBATIM
Constant for unformatted (verbatim) parameter type.
|
static java.lang.String |
DB_ROLE_DATA
Constant for "data" database role.
|
static java.lang.String |
DB_ROLE_SCHEMA
Constant for "schema" database role.
|
static java.lang.String |
DB_ROLE_SECURITY
Constant for "security" database role.
|
static java.lang.String |
ROLE_MAIN
Constant for "main" table role.
|
static java.lang.String |
ROLE_STANDARD
Constant for "standard" table role.
|
static java.lang.String |
SORT_ASC
Constant for ascending sort order.
|
static java.lang.String |
SORT_DESC
Constant for descending sort order.
|
Modifier and Type | Method and Description |
---|---|
DataSource |
addCalculatedField(com.archibus.datasource.VirtualFieldDef calculatedField)
Adds a calculated field to the data source.
|
DataSource |
addField(java.lang.String name)
Adds specified main table field to the data source query.
|
DataSource |
addField(java.lang.String[] names)
Adds specified main table fields to the data source query.
|
DataSource |
addField(java.lang.String table,
java.lang.String name)
Adds specified field to the data source query.
|
DataSource |
addField(java.lang.String table,
java.lang.String[] names)
Adds specified fields to the data source query.
|
DataSource |
addParameter(java.lang.String name,
double value,
java.lang.String dataType) |
DataSource |
addParameter(java.lang.String name,
int value,
java.lang.String dataType) |
DataSource |
addParameter(java.lang.String name,
java.lang.Object value,
java.lang.String dataType) |
DataSource |
addParameter(java.lang.String name,
java.lang.String value,
java.lang.String dataType)
Adds a query parameter.
|
DataSource |
addQuery(java.lang.String sql)
Adds a generic dialect SQL query to the data source.
|
DataSource |
addQuery(java.lang.String sql,
java.lang.String dialect)
Adds an SQL query to the data source.
|
DataSource |
addRestriction(com.archibus.datasource.restriction.Restrictions.Restriction.Clause c)
Adds a restriction clause.
|
DataSource |
addRestriction(com.archibus.datasource.restriction.Restrictions.Restriction r)
Adds a restriction.
|
DataSource |
addSort(java.lang.String name)
Adds a main table sort field to the data source query, in SORT_ASC mode.
|
DataSource |
addSort(java.lang.String table,
java.lang.String name)
Adds a sort field to the data source query, in SORT_ASC mode.
|
DataSource |
addSort(java.lang.String table,
java.lang.String name,
java.lang.String order)
Adds a sort field to the data source query.
|
DataSource |
addTable(java.lang.String name)
Adds specified table to the data source query, as a "main" table.
|
DataSource |
addTable(java.lang.String name,
java.lang.String role)
Adds specified table in specified role to the data source query.
|
DataSource |
addVirtualField(java.lang.String table,
java.lang.String name,
java.lang.String dataType)
Adds a virtual field to the data source.
|
DataSource |
addVirtualField(java.lang.String table,
java.lang.String name,
java.lang.String dataType,
int size,
int decimals)
Adds a virtual field to the data source.
|
DataSource |
addVirtualField(java.lang.String table,
java.lang.String name,
java.lang.String dataType,
int size,
int decimals,
java.lang.String title) |
DataSource |
clearRestrictions()
Clears all restrictions defined in AXVW.
|
void |
commit()
Commit current database transaction.
|
com.archibus.datasource.data.DataRecord |
createNewRecord()
Creates new DataRecord with default values for all fields defined in the data source.
|
org.json.JSONArray |
createPrimaryKeyIds()
Creates primary key column definitions in JSON format from the data source.
|
com.archibus.datasource.data.DataRecord |
createRecord()
Creates new DataRecord with default values for all fields defined in the data source.
|
com.archibus.datasource.data.DataRecord |
createRecordFromContext()
Creates new DataRecord with default values for all fields defined in the data source.
|
com.archibus.db.ViewField.Immutable |
createVirtualViewField(java.lang.String table,
java.lang.String name,
java.lang.String fieldJavaType,
java.text.NumberFormat format)
Creates and returns virtual view field for specified Java field type.
|
void |
deleteRecord(com.archibus.datasource.data.DataRecord record)
Deletes existing record.
|
void |
deleteRecord(java.util.Map fieldValues)
Deletes record specified by field values.
|
void |
enableIdLookup(boolean value)
Sets the idLookupEnabled property.
|
void |
executeUpdate()
Executes SQL update query, set using addQuery().
|
void |
executeUpdateRequired()
Executes SQL update query, set using addQuery().
|
com.archibus.db.ViewField.Immutable |
findField(java.lang.String fullName)
Returns a field definition for specified full field name.
|
com.archibus.db.ViewField.Immutable |
findVirtualField(java.lang.String fullName)
Loop through the virtual fields for the current data source and Returns a field definition
for specified full field name.
|
java.lang.String |
formatJoin(java.lang.String fieldName)
Generates a join between the table of specified field and its validating table, if any.
|
java.lang.String |
formatSqlForPersistentRestrictions()
Generates SQL WHERE clause from VPAs for current user/role applicable to the main table in
current DataSource.
|
java.lang.String |
formatSqlForPersistentRestrictionsForTable(java.lang.String tableName)
Generates SQL WHERE clause from VPAs for current user/role applicable to the specified table
in current DataSource.
|
java.lang.String |
formatSqlForPersistentRestrictionsForTableAndRole(java.lang.String tableName,
java.lang.String roleName)
Generates SQL WHERE clause from VPAs applicable to the specified table in current DataSource.
|
java.lang.String |
formatSqlForRestriction(java.lang.String id)
Generates SQL WHERE clause from a named restriction.
|
java.lang.String |
formatSqlQuery(java.lang.String restriction,
boolean doNotWrap)
Formats and returns an SQL query based on: previously added tables, fields, sort fields,
restrictions, and custom SQL queries; current user VPA restriction; client-side restriction.
|
java.lang.String |
formatSqlQuery(java.lang.String restriction,
java.util.List sortValues,
java.util.List filterValues,
boolean isOrderbyAllowed,
boolean doNotWrap)
Formats and returns an SQL query based on: previously added tables, fields, sort fields,
restrictions, and custom SQL queries; current user VPA restriction; client-side restriction.
|
java.lang.String |
formatSqlQueryForField(java.lang.String restriction,
java.util.List sortValues,
java.util.List filterValues,
boolean isOrderbyAllowed,
boolean doNotWrap,
java.lang.String fieldName)
Formats and returns an SQL query that selects a single specified field.
|
java.util.List<com.archibus.db.ViewField.Immutable> |
getAllFields()
Returns a list of field definitions for visible and/or virtual fields.
|
java.util.List<com.archibus.datasource.data.DataRecord> |
getAllRecords()
Retrieves records that contains values for all fields defined in the data source, using no
record limit.
|
com.archibus.datasource.VirtualFieldDef |
getCalculatedFieldDef(java.lang.String tableName,
java.lang.String fieldName)
Returns specified virtual field definition.
|
com.archibus.model.view.datasource.AbstractDataSourceDef |
getDataSourceDef() |
java.util.List<EventHandlerBase.DbField> |
getDbFieldsForNewRecord()
Returns a list of DB field definitions for default new record.
|
java.util.Map<java.lang.String,EventHandlerBase.DbField> |
getDbFieldsForPrimaryKeysAsMap()
Returns a map of DB field definitions for key fields.
|
java.util.List<EventHandlerBase.DbField> |
getDbFieldsForVisibleFields()
Returns a list of DB field definitions for all fields defined in the data source.
|
com.archibus.datasource.data.DataRecord |
getDefaultRecord(java.lang.String restriction)
Returns DataRecord with default values for all fields defined in the data source.
|
java.util.List<java.lang.String> |
getFieldNames() |
java.lang.String |
getId() |
com.archibus.schema.TableDef.ThreadSafe |
getMainTableDef()
Returns main table definition.
|
java.lang.String |
getMainTableName()
Returns main table name.
|
java.util.Map<java.lang.String,DataSourceImpl.Parameter> |
getParameters()
Returns all parameters.
|
java.util.List<java.lang.String> |
getPrimaryKeyFieldNamesForTable(java.lang.String tableName)
Returns a collection of the main table's primary key field names.
|
java.util.List<com.archibus.db.ViewField.Immutable> |
getPrimaryKeyFields()
Returns a list of primary key fields.
|
com.archibus.datasource.SqlExpressions |
getQueries()
Returns all custom queries.
|
com.archibus.datasource.data.DataRecord |
getRecord()
Retrieves a single record that contains values for all fields defined in the data source.
|
com.archibus.datasource.data.DataRecord |
getRecord(java.lang.String restriction)
Retrieves a single record that contains values for all fields defined in the data source.
|
java.util.List<com.archibus.datasource.data.DataRecord> |
getRecords()
Retrieves records that contains values for all fields defined in the data source.
|
java.util.List<com.archibus.datasource.data.DataRecord> |
getRecords(com.archibus.model.view.datasource.AbstractRestrictionDef restriction)
Retrieves records that contains values for all fields defined in the data source.
|
java.util.List<com.archibus.datasource.data.DataRecord> |
getRecords(java.util.List<com.archibus.db.RestrictionSqlBase.Immutable> restrictions)
Retrieves records that contains values for all fields defined in the data source.
|
java.util.List<com.archibus.datasource.data.DataRecord> |
getRecords(java.util.List<com.archibus.db.RestrictionSqlBase.Immutable> restrictions,
int maxRecords)
Retrieves records that contains values for all fields defined in the data source.
|
java.util.List<com.archibus.datasource.data.DataRecord> |
getRecords(java.lang.String restriction)
Retrieves records that contains values for all fields defined in the data source.
|
java.util.List<com.archibus.datasource.data.DataRecord> |
getRecords(java.lang.String restriction,
int maxRecords)
Retrieves records that contains values for all fields defined in the data source.
|
java.util.List<com.archibus.datasource.restriction.Restrictions.Restriction> |
getRestrictions()
Returns a list of restriction definitions.
|
java.util.Map<java.lang.String,java.lang.Object> |
getRestrictionValues()
Returns restrictions values passed in from the client.
|
java.util.List<DataSourceImpl.SortField> |
getSortFields()
Returns a list of sort field definitions.
|
java.util.List<DataSourceImpl.TableAndRole> |
getTablesAndRoles()
Returns a list of table names and roles.
|
java.lang.String |
getTitle() |
java.lang.String |
getViewName() |
com.archibus.datasource.VirtualFieldDef |
getVirtualFieldDef(java.lang.String tableName,
java.lang.String fieldName)
Returns specified virtual field definition.
|
java.util.List<com.archibus.db.ViewField.Immutable> |
getVirtualFields()
Returns a list of virtual fields.
|
java.util.List<com.archibus.db.ViewField.Immutable> |
getVisibleFields()
Returns a list of visible fields.
|
java.util.Map<java.lang.String,com.archibus.db.ViewField.Immutable> |
getVisibleFieldsByName()
Returns a map of visible fields.
|
boolean |
hasCustomQuery()
Returns true if the data source uses custom SQL qeury.
|
boolean |
hasMoreRecords()
Returns true if preceding call to retrieveRecords() did not read all records due to record
limit.
|
boolean |
hasVirtualFields()
Returns true if the data source defines virtual fields for custom SQL qeury.
|
boolean |
isDistinct()
Gets the distinct attribute
|
boolean |
isIdLookupEnabled()
Whether this data source can use lookup fields.
|
boolean |
isOracle()
Returns true if the current database server is Oracle.
|
boolean |
isSqlServer()
Returns true if the current database server is SQL Server.
|
boolean |
isSybase()
Returns true if the current database server is Sybase.
|
java.util.List<com.archibus.db.RestrictionSqlBase.Immutable> |
parseClientRestrictions(java.lang.String restrictionString)
Creates parsed or SQL restriction from the string input parameter.
|
void |
queryRecords(DataSource.RecordHandler recordHandler)
Executes SQL query and calls specified callback for each retrieved record.
|
void |
queryRecords(java.lang.String restriction,
DataSource.RecordHandler recordHandler)
Executes SQL query and calls specified callback for each retrieved record.
|
void |
rollback()
Rollback current database transaction.
|
com.archibus.datasource.data.DataRecord |
saveRecord(com.archibus.datasource.data.DataRecord record)
Saves new or updates existing record.
|
DataSource |
setApplyVpaRestrictions(boolean applyVpaRestrictions)
The applyVpaRestrictions property enables or disables VPA restrictions for all read queries,
whether the Data Source uses custom SQL or not.
|
DataSource |
setAutoCommit(boolean autoCommit)
Sets the autoCommit flag.
|
DataSource |
setContext()
Sets data source context and initializes context-dependent data source state based on the
current thread context.
|
DataSource |
setContext(com.archibus.config.ContextCacheable.Immutable context)
Sets data source context and initializes context-dependent data source state.
|
DataSource |
setContext(EventHandlerContext eventHandlerContext)
Sets data source context and initializes context-dependent data source state.
|
DataSource |
setDatabaseRole(java.lang.String role)
Set database role for this DataSource to access.
|
void |
setDataSourceDef(com.archibus.model.view.datasource.AbstractDataSourceDef dataSourceDef) |
DataSource |
setDistinct(boolean isDistinct)
Sets isDistinct flag.
|
void |
setId(java.lang.String id) |
DataSource |
setMaxRecords(int maxRecords)
Sets the max number of records that can be retrieved by consequent calls to
retrieveRecords().
|
DataSource |
setParameter(java.lang.String name,
java.lang.Object value)
Sets new value for specified parameter.
|
void |
setTitle(java.lang.String title) |
DataSource |
setUseHierarchicalSecurityRestriction(boolean useHierarchicalSecurityRestriction)
Sets the useHierarchicalSecurityRestriction property.
|
void |
setViewName(java.lang.String viewName) |
void |
updateRecord(com.archibus.datasource.data.DataRecord record)
Updates existing record specified by the primary key values.
|
static final java.lang.String DATA_TYPE_BOOLEAN
static final java.lang.String DATA_TYPE_CURRENCY
static final java.lang.String DATA_TYPE_DATE
static final java.lang.String DATA_TYPE_DOUBLE
static final java.lang.String DATA_TYPE_INTEGER
static final java.lang.String DATA_TYPE_MEMO
static final java.lang.String DATA_TYPE_NUMBER
static final java.lang.String DATA_TYPE_TEXT
static final java.lang.String DATA_TYPE_TIME
static final java.lang.String DATA_TYPE_VERBATIM
static final java.lang.String DB_ROLE_DATA
static final java.lang.String DB_ROLE_SCHEMA
static final java.lang.String DB_ROLE_SECURITY
static final java.lang.String ROLE_MAIN
static final java.lang.String ROLE_STANDARD
static final java.lang.String SORT_ASC
static final java.lang.String SORT_DESC
DataSource addCalculatedField(com.archibus.datasource.VirtualFieldDef calculatedField)
calculatedField
- The calculated field definition.DataSource addField(java.lang.String name)
name
- Field name, i.e. "status".DataSource addField(java.lang.String table, java.lang.String name)
table
- Table name, i.e. "wr".name
- Field name, i.e. "status".DataSource addField(java.lang.String table, java.lang.String[] names)
table
- Table name, i.e. "wr".names
- Array of field names.DataSource addField(java.lang.String[] names)
names
- Array of field names.DataSource addParameter(java.lang.String name, double value, java.lang.String dataType)
DataSource addParameter(java.lang.String name, int value, java.lang.String dataType)
DataSource addParameter(java.lang.String name, java.lang.Object value, java.lang.String dataType)
DataSource addParameter(java.lang.String name, java.lang.String value, java.lang.String dataType)
name
- Parameter name.value
- Parameter value.dataType
- Parameter type, used to parse the value into an object.DataSource addQuery(java.lang.String sql)
sql
- The SQL.DataSource addQuery(java.lang.String sql, java.lang.String dialect)
sql
- The SQL.dialect
- SQL dialect: generic|sybase|oracle|sqlserverDataSource addRestriction(com.archibus.datasource.restriction.Restrictions.Restriction r)
r
- Restriction.DataSource addRestriction(com.archibus.datasource.restriction.Restrictions.Restriction.Clause c)
c
- Restriction clause.DataSource addSort(java.lang.String name)
name
- Field name, i.e. "status".DataSource addSort(java.lang.String table, java.lang.String name)
table
- Table name, i.e. "wr".name
- Field name, i.e. "status".DataSource addSort(java.lang.String table, java.lang.String name, java.lang.String order)
table
- Table name, i.e. "wr".name
- Field name, i.e. "status".order
- Sort order: asc|desc.DataSource addTable(java.lang.String name)
name
- Table name, i.e. "wr".DataSource addTable(java.lang.String name, java.lang.String role)
name
- Table name, i.e. "wr".role
- Table role, i.e. "standard".DataSource addVirtualField(java.lang.String table, java.lang.String name, java.lang.String dataType)
table
- Table name, matching the SQL query table alias.name
- Virtual field name, matching the calculated SQL column name.dataType
- Virtual field type: text|number|date|time|memo|verbatim.DataSource addVirtualField(java.lang.String table, java.lang.String name, java.lang.String dataType, int size, int decimals)
table
- Table name, matching the SQL query table alias.name
- Virtual field name, matching the calculated SQL column name.dataType
- Virtual field type: text|number|date|time|memo|verbatim.size
- For numeric field, the number of integer digits.decimals
- For numeric field, the number of fraction digits.DataSource addVirtualField(java.lang.String table, java.lang.String name, java.lang.String dataType, int size, int decimals, java.lang.String title)
DataSource clearRestrictions()
void commit()
com.archibus.datasource.data.DataRecord createNewRecord()
org.json.JSONArray createPrimaryKeyIds()
com.archibus.datasource.data.DataRecord createRecord()
com.archibus.datasource.data.DataRecord createRecordFromContext()
com.archibus.db.ViewField.Immutable createVirtualViewField(java.lang.String table, java.lang.String name, java.lang.String fieldJavaType, java.text.NumberFormat format)
table
- Virtual field table name.name
- Virtual field name.fieldJavaType
- Java class name, such as "java.lang.Double" or "java.sql.Date".format
- NumberFormat instance for numeric felds, or null for other fields.void deleteRecord(com.archibus.datasource.data.DataRecord record)
record
- DataRecord containing record to be deleted.void deleteRecord(java.util.Map fieldValues)
fieldValues
- map containing record values.void enableIdLookup(boolean value)
value
- The property value.void executeUpdate()
void executeUpdateRequired()
com.archibus.db.ViewField.Immutable findField(java.lang.String fullName)
fullName
- Full field name, i.e. "wr.status".com.archibus.db.ViewField.Immutable findVirtualField(java.lang.String fullName)
fullName
- Full field name, i.e. "wr.status".java.lang.String formatJoin(java.lang.String fieldName)
Example: for rm.dp_id produce (LEFT OUTER JOIN dp ON rm.dp_id = dp.dp_id)
fieldName
- The field name.java.lang.String formatSqlForPersistentRestrictions()
java.lang.String formatSqlForPersistentRestrictionsForTable(java.lang.String tableName)
tableName
- of main or standard table in the current DataSource for which to generate
SQL.java.lang.String formatSqlForPersistentRestrictionsForTableAndRole(java.lang.String tableName, java.lang.String roleName)
tableName
- of main or standard table in the current DataSource for which to generate
SQL.roleName
- of user role. Can be null.java.lang.String formatSqlForRestriction(java.lang.String id)
id
- The restriction ID.java.lang.String formatSqlQuery(java.lang.String restriction, boolean doNotWrap)
restriction
- String containing client-side restriction in JSON format.doNotWrap
- True if the data source should not wrap the custom SQL query.java.lang.String formatSqlQuery(java.lang.String restriction, java.util.List sortValues, java.util.List filterValues, boolean isOrderbyAllowed, boolean doNotWrap)
restriction
- String containing client-side restriction in JSON format.sortValues
- The list sort values.filterValues
- The list of filter values.isOrderbyAllowed
- True if the data source can apply the ORDER BY clause.doNotWrap
- True if the data source should not wrap the custom SQL query.java.lang.String formatSqlQueryForField(java.lang.String restriction, java.util.List sortValues, java.util.List filterValues, boolean isOrderbyAllowed, boolean doNotWrap, java.lang.String fieldName)
restriction
- String containing client-side restriction in JSON format.sortValues
- The list sort values.filterValues
- The list of filter values.isOrderbyAllowed
- True if the data source can apply the ORDER BY clause.doNotWrap
- True if the data source should not wrap the custom SQL query.fieldName
- The field name.java.util.List<com.archibus.db.ViewField.Immutable> getAllFields()
java.util.List<com.archibus.datasource.data.DataRecord> getAllRecords()
com.archibus.datasource.VirtualFieldDef getCalculatedFieldDef(java.lang.String tableName, java.lang.String fieldName)
tableName
- The table name.fieldName
- The field name.com.archibus.model.view.datasource.AbstractDataSourceDef getDataSourceDef()
java.util.List<EventHandlerBase.DbField> getDbFieldsForNewRecord()
java.util.Map<java.lang.String,EventHandlerBase.DbField> getDbFieldsForPrimaryKeysAsMap()
java.util.List<EventHandlerBase.DbField> getDbFieldsForVisibleFields()
com.archibus.datasource.data.DataRecord getDefaultRecord(java.lang.String restriction)
restriction
- Client-supplied restriction string, or null.java.util.List<java.lang.String> getFieldNames()
java.lang.String getId()
com.archibus.schema.TableDef.ThreadSafe getMainTableDef()
java.lang.String getMainTableName()
java.util.Map<java.lang.String,DataSourceImpl.Parameter> getParameters()
java.util.List<java.lang.String> getPrimaryKeyFieldNamesForTable(java.lang.String tableName)
tableName
- The table name.java.util.List<com.archibus.db.ViewField.Immutable> getPrimaryKeyFields()
com.archibus.datasource.SqlExpressions getQueries()
com.archibus.datasource.data.DataRecord getRecord()
com.archibus.datasource.data.DataRecord getRecord(java.lang.String restriction)
restriction
- The client-side restriction.java.util.List<com.archibus.datasource.data.DataRecord> getRecords()
java.util.List<com.archibus.datasource.data.DataRecord> getRecords(com.archibus.model.view.datasource.AbstractRestrictionDef restriction)
restriction
- The restriction definition.java.util.List<com.archibus.datasource.data.DataRecord> getRecords(java.util.List<com.archibus.db.RestrictionSqlBase.Immutable> restrictions)
restrictions
- The list of restrictions defined using the DB package types.java.util.List<com.archibus.datasource.data.DataRecord> getRecords(java.util.List<com.archibus.db.RestrictionSqlBase.Immutable> restrictions, int maxRecords)
restrictions
- The list of restrictions defined using the DB package types.maxRecords
- The record limit, or 0 if there is no record limit.java.util.List<com.archibus.datasource.data.DataRecord> getRecords(java.lang.String restriction)
restriction
- Client-supplied restriction string, or null.java.util.List<com.archibus.datasource.data.DataRecord> getRecords(java.lang.String restriction, int maxRecords)
restriction
- Client-supplied restriction string, or null.maxRecords
- The record limit, or 0 if there is no record limit.java.util.List<com.archibus.datasource.restriction.Restrictions.Restriction> getRestrictions()
java.util.Map<java.lang.String,java.lang.Object> getRestrictionValues()
java.util.List<DataSourceImpl.SortField> getSortFields()
java.util.List<DataSourceImpl.TableAndRole> getTablesAndRoles()
java.lang.String getTitle()
java.lang.String getViewName()
com.archibus.datasource.VirtualFieldDef getVirtualFieldDef(java.lang.String tableName, java.lang.String fieldName)
tableName
- The table name.fieldName
- The field name.java.util.List<com.archibus.db.ViewField.Immutable> getVirtualFields()
java.util.List<com.archibus.db.ViewField.Immutable> getVisibleFields()
java.util.Map<java.lang.String,com.archibus.db.ViewField.Immutable> getVisibleFieldsByName()
boolean hasCustomQuery()
boolean hasMoreRecords()
boolean hasVirtualFields()
boolean isDistinct()
boolean isIdLookupEnabled()
boolean isOracle()
boolean isSqlServer()
boolean isSybase()
java.util.List<com.archibus.db.RestrictionSqlBase.Immutable> parseClientRestrictions(java.lang.String restrictionString)
restrictionString
- can contain: - single XML record; - single JSON record; - multiple
JSON records; - literal SQL expression;void queryRecords(DataSource.RecordHandler recordHandler)
recordHandler
- The callback.void queryRecords(java.lang.String restriction, DataSource.RecordHandler recordHandler)
restriction
- The client-side restriction.recordHandler
- The callback.void rollback()
com.archibus.datasource.data.DataRecord saveRecord(com.archibus.datasource.data.DataRecord record)
record
- DataRecord containing record values to be saved and old values.DataSource setApplyVpaRestrictions(boolean applyVpaRestrictions)
applyVpaRestrictions
- The property value.DataSource setAutoCommit(boolean autoCommit)
autoCommit
- The flag value.DataSource setContext()
DataSource setContext(com.archibus.config.ContextCacheable.Immutable context)
context
- Web Central context object, typically a UserSession.DataSource setContext(EventHandlerContext eventHandlerContext)
eventHandlerContext
- WFR event handler context.DataSource setDatabaseRole(java.lang.String role)
role
- The database role.void setDataSourceDef(com.archibus.model.view.datasource.AbstractDataSourceDef dataSourceDef)
dataSourceDef
- the dataSourceDef to setDataSource setDistinct(boolean isDistinct)
isDistinct
- The flag value.void setId(java.lang.String id)
id
- the id to setDataSource setMaxRecords(int maxRecords)
maxRecords
- Positive number, or 0 to read all available records without limit.DataSource setParameter(java.lang.String name, java.lang.Object value)
name
- Parameter name.value
- Parameter value.void setTitle(java.lang.String title)
title
- the title to setDataSource setUseHierarchicalSecurityRestriction(boolean useHierarchicalSecurityRestriction)
useHierarchicalSecurityRestriction
- The property value.void setViewName(java.lang.String viewName)
viewName
- the view name to setvoid updateRecord(com.archibus.datasource.data.DataRecord record)
record
- DataRecord containing record values to be saved.