Interface DataDescriptor
- All Known Implementing Classes:
BaseDataDescriptor
,InMemoryDataDescriptor
,JPADataDescriptor
,SQLDataDescriptor
The DataDescriptor class
In the DataDescriptor class, the data structure and related display and editing interfaces, filters, and data accesses can be specified. With these parameters an editing or display interfaces can be created easily, since the JBStrap data handling components can all be built from DataDescriptor. Furthermore, the DataDescriptor supports both synchronous and asynchronous data handling operations.
A DataDescriptor in the JBStrap framework can be created through code, instantiating this class and specifying the parameters, or based on an XML file.
The XML files are read automatically by the framework on the system startup, and creates the classes, and adds the DataDescriptors to the framework,
so these DataDescriptors can be accessed at any point in the application. The XML files must be located in the directory specified in the
DATADESCRIPTOR_DIR
JBStrap parameter.
If a DataDescriptor is created through code, (eg. based on data from a database), then the created DataDescriptor objects have to be added to the framework, by using the
addDataDescriptor()
method.
A previously added DataDescriptor can be queried from the framework, by using the getDataDescriptor()
method.
If the DataDescriptor is parameterized in the XML file, then the file extension must be .ds.xml
. The DataDescriptor parameters must be in the
datadescriptor
tags.
The possible DataDescriptor tag attributes:
Attribute name | Description | Default |
---|---|---|
name | The unique DataDescriptor name. This parameter must be specified. The name specified here is used to get the DataDescriptor from the framework. | null |
dataClass | The POJO class/entity containing the DataDescriptor data. If using a JPA DataDescriptor, the type of the created JPA entity (through which the data will flow from the DataDescriptor to the component) can be specified here. | null |
connectorType | The data connector type. | JPA |
The datadescriptor tag's possible elements, that have to be specified in the tags within the tags:
- Tag name
Description | Default | |
---|---|---|
type | The access type. The parameter's values can be found in the AccessType enum | PRIVATE |
read | The roles that grant read access to the DataDescriptor. The "*" character can be used as a wildcard. The roles must be separated by a comma (","). | * |
write | The roles that grant write access to the DataDescriptor. The "*" character can be used as a wildcard. The roles must be separated by a comma (","). | * |
A DataDescriptor, that every user can read and write, regardless if they are signed in or not:
<access> <type>Public</type> </access>A DataDescriptor that every logged in user can read, but only certain users (users with the "ADMIN" role, or a role that contains the "POWER" prefix) can write.
<access> <type>Private</type> <read>*</read> <write>ADMIN,POWER*</write> </access>
This parameter is used to specify the default filter criteria used with the DataDescriptor. The user cannot turn this off, or modify it. If the DataDescriptor is displayed on a list interface and the user can filter the data, the filter set by the user will be applied to the data that was already filtered by the default filter.
For example, if we only want the data displayed that are stored in the field called "column1", and start with "A", it looks like this:
<defaultFilterCriteria>Criteria("column1",LIKE,"A")</defaultFilterCriteria>
This tag can be used multiple times within the DataDescriptor. The individual columns of the DataDescriptor can be defined and set with the help of this tag. For more information about the DataDescriptor column parameters, see the
DataDescriptorColumn
class.
- Since:
- 4.0
- Author:
- JBStrap
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddColumn
(DataDescriptorColumn column) Adds column data to the DataDescriptoraddColumns
(DataDescriptorColumn... columns) Adds multiple columns to the DataDescriptorAdds a parameter to the DataDescriptor.copy()
Creates a copy of the DataDescriptorlong
Counts data in the DataDescriptor, following the specified criterialong
Counts data in the DataDescriptorvoid
fetchData
(int startRow, int endRow, Criteria criteria, Order order, Client client, DataDescriptorCallback callback) Fetches data from the DataDescriptor, between the specified rows, with the specified order and criteriavoid
fetchData
(int startRow, int endRow, Criteria criteria, Client client, DataDescriptorCallback callback) Fetches data from the DataDescriptor, between the specified rows, asynchronously.void
fetchData
(int startRow, int endRow, Criteria criteria, List<Order> orders, Client client, DataDescriptorCallback callback) Fetches data from the DataDescriptor, between the specified rows, with the specified orders and criteriavoid
fetchData
(Criteria criteria, Order order, Client client, DataDescriptorCallback callback) Fetches data from the DataDescriptor, with the specified order and criteriavoid
fetchData
(Criteria criteria, Client client, DataDescriptorCallback callback) Fetches data from the DataDescriptor asynchronously.void
Fetches data from the DataDescriptor, with the specified orders and criteriafind()
Queries the DataDescriptor data synchronously.Queries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rowsQueries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rows, ordered.Queries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rows, following the specified orders.Queries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rows, following the specified orders.Queries the DataDescriptor data synchronously, that meet the specified criteriaQueries the DataDescriptor data synchronously.Queries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rowsQueries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rows, ordered.Queries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rows, following the specified orders.Queries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rows, following the specified orders.Queries the DataDescriptor data synchronously, that meet the specified criteriaGets a DataDescriptor record, using the specified ID.Gets a DataDescriptor record, using the specified ID.Gets the DataDescriptor access typeGets the specified column from the DataDescriptorGets the data of the DataDescriptor columnsGets the default filter criteria assigned to the DataDescriptorgetName()
Gets the name of the DataDescriptor<C> C
Gets the DataDescriptor parameter vale, specified by the parameter name.Gets the name of the column, which contains the primary keys.Gets a list, containing the names of the columns, which contain the primary keys.getRead()
Gets a list of roles that have read access to the DataDescriptor.getWrite()
Gets a list of roles that have write access to the DataDescriptor.boolean
Determines if the user can filter the DataDescriptorRemoves a record from the DataDescriptorRemoves a record from the DataDescriptorremove
(Record record, Client client, Transaction transaction) Removes a record from the DataDescriptor, within the specified transaction.void
remove
(Record record, Client client, DataDescriptorCallback callback) Removes a record asynchronously from the DataDescriptorvoid
remove
(Record record, Client client, DataDescriptorCallback callback, Transaction transaction) Removes a record asynchronously from the DataDescriptor, within the specified transactionRemoves multiple records from the DataDescriptorremove
(List<Record> records, Client client, Transaction transaction) Removes multiple records from the DataDescriptor within the specified transactionvoid
remove
(List<Record> records, Client client, DataDescriptorCallback callback) Removes multiple records asynchronously from the DataDescriptorvoid
remove
(List<Record> records, Client client, DataDescriptorCallback callback, Transaction transaction) Removes multiple records asynchronously from the DataDescriptor, within the specified transactionSaves a record to the DataDescriptor.Saves a record to the DataDescriptor.save
(Record record, Client client, Transaction transaction) Saves a record to the DataDescriptor, within the specified database transaction.void
save
(Record record, Client client, DataDescriptorCallback callback) Saves a record asynchronously to the database.void
save
(Record record, Client client, DataDescriptorCallback callback, Transaction transaction) Saves a record asynchronously to the database, within the specified database transaction.Saves multiple records to the DataDescriptor.save
(List<Record> records, Client client, Transaction transaction) Saves multiple records to the DataDescriptor.void
save
(List<Record> records, Client client, DataDescriptorCallback callback) Saves a record asynchronously to the database, within the specified database transaction.void
save
(List<Record> records, Client client, DataDescriptorCallback callback, Transaction transaction) Saves multiple records asynchronously to the DataDescriptor, within the specified database transaction.setAccess
(AccessType access) Sets the DataDescriptor access typesetDefaultFilterCriteria
(Criteria criteria) Sets the default filter criteria, that will be used by the DatDescriptorsetParam
(Parameters params) Sets the DataDescriptor parameters.Sets the specified roles to have read access to the DataDescriptor.Sets the specified roles to have write access to the DataDescriptor.
-
Method Details
-
getName
String getName()Gets the name of the DataDescriptor- Returns:
- The name of the DataDescriptor
-
addColumn
Adds column data to the DataDescriptor- Parameters:
column
- The data descriptor column object, that contains the data of the column- Returns:
- The DataDescriptor
- Throws:
NullPointerException
- If the column was specified asnull
-
addColumns
Adds multiple columns to the DataDescriptor- Parameters:
columns
- The columns to be added to the DataDescriptor- Returns:
- The DataDescriptor
- Throws:
NullPointerException
- If the columns were specified asnull
-
getColumns
Collection<DataDescriptorColumn> getColumns()Gets the data of the DataDescriptor columns- Returns:
- A collecton containing the data of the DataDescriptor columns. It will return
null
, if the DataDescriptor has no columns.
-
getColumn
Gets the specified column from the DataDescriptor- Parameters:
name
- The name of the column- Returns:
- The DataDescriptor column with the specified name, or
null
if not found
-
getRead
Gets a list of roles that have read access to the DataDescriptor. If a "*" character is used when specifying roles, it will also appear on the list.- Returns:
- A list of role names that have read access to the DataDescriptor
-
setRead
Sets the specified roles to have read access to the DataDescriptor.- Parameters:
read
- A list of role names, that will have read access. The "*" character can be used as a wildcard.- Returns:
- The DataDescriptor
-
getWrite
Gets a list of roles that have write access to the DataDescriptor. If a "*" character is used when specifying roles, it will also appear on the list.- Returns:
- A list of role names that have write access to the DataDescriptor
-
setWrite
Sets the specified roles to have write access to the DataDescriptor.- Parameters:
write
- A list of role names, that will have write access. The "*" character can be used as a wildcard.- Returns:
- The DataDescriptor
-
getAccess
AccessType getAccess()Gets the DataDescriptor access type- Returns:
- The DataDescriptor access type
-
setAccess
Sets the DataDescriptor access type- Parameters:
access
- The DataDescriptor access type. The parameter values can be found in theAccessType
enum.- Returns:
- The DataDescriptor
-
getPrimaryKeyNames
Gets a list, containing the names of the columns, which contain the primary keys.- Returns:
- A list of column names, that contain the DataDescriptor primary keys. If the DataDescriptor contains no primary key, it will return with
null
-
getPrimaryKeyName
String getPrimaryKeyName()Gets the name of the column, which contains the primary keys. (Only usable if the DataDescriptor only has one primary key column.)- Returns:
- The name of the column, which contains the primary keys. If the DataDescriptor has no primary key, it will return with
null
If the DataDescriptor contains multiple primary key columns, it will return with the name of the first column.
-
copy
DataDescriptor copy()Creates a copy of the DataDescriptor- Returns:
- A new DataDescriptor, that is a perfect copy of the DataDescriptor
-
getDefaultFilterCriteria
Criteria getDefaultFilterCriteria()Gets the default filter criteria assigned to the DataDescriptor- Returns:
- The default filter criteria assigned to the DataDescriptor or
null
, if none was assigned
-
setDefaultFilterCriteria
Sets the default filter criteria, that will be used by the DatDescriptor- Parameters:
criteria
- The default filter criteria. Ifnull
, no filter criteria will be set to the DataDescriptor- Returns:
- The DataDescriptor
-
isFilterable
boolean isFilterable()Determines if the user can filter the DataDescriptor- Returns:
- If
true
, the user can filter the DataDescriptor, otherwisefalse
-
addParam
Adds a parameter to the DataDescriptor.- Parameters:
name
- The name of the parameter to be added to the DataDescriptor. If the parameter name is already used on the DataDescriptor, it will be overwritten.value
- The parameter value- Returns:
- The DataDescriptor
-
setParam
Sets the DataDescriptor parameters. If this method is used, the previous parameter settings will be lost.- Parameters:
params
- The DataDescriptor parameters.- Returns:
- The DataDescriptor
-
getParam
Gets the DataDescriptor parameter vale, specified by the parameter name.- Parameters:
name
- The name of the parameter.- Returns:
- The value of the specified parameter, or
null
if not found.
-
find
Queries the DataDescriptor data synchronously.- Returns:
- A list containing every record in the DataDescriptor
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the access rights are not correctly set for the query
-
find
Queries the DataDescriptor data synchronously.- Parameters:
client
- The client that started the query. Ifnull
, the query will happen without checking for access rights.- Returns:
- A list containing every record in the DataDescriptor
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the user in the specified client has no access to read the data.
-
find
Queries the DataDescriptor data synchronously, that meet the specified criteria- Parameters:
criteria
- The criteria used during the query. Ifnull
, no criteria will be used, every record will be queried.- Returns:
- The list of records that meet the specified filter criteria.
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the user in the specified client has no access to read the data.
-
find
Queries the DataDescriptor data synchronously, that meet the specified criteria- Parameters:
client
- The client that started the query. Ifnull
, the query will happen without checking for access rights.criteria
- The criteria used during the query. Ifnull
, no criteria will be used, every record will be queried.- Returns:
- The list of records that meet the specified filter criteria.
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the user in the specified client has no access to read the data.
-
find
List<Record> find(int startRow, int endRow, Criteria criteria) throws FindException, DataAccessException Queries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rows- Parameters:
startRow
- The first row of the query, which will appear in the returned listendRow
- The last row of the query, which will appear in the returned listcriteria
- The criteria used during the query. Ifnull
, no criteria will be used, every record will be queried.- Returns:
- The list of records that meet the specified filter criteria.
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the user in the specified client has no access to read the data.
-
find
List<Record> find(Client client, int startRow, int endRow, Criteria criteria) throws FindException, DataAccessException Queries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rows- Parameters:
client
- The client that started the query. Ifnull
, the query will happen without checking for access rights.startRow
- The first row of the query, which will appear in the returned listendRow
- The last row of the query, which will appear in the returned listcriteria
- The criteria used during the query. Ifnull
, no criteria will be used, every record will be queried.- Returns:
- The list of records that meet the specified filter criteria.
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the user in the specified client has no access to read the data.
-
find
List<Record> find(int startRow, int endRow, Criteria criteria, Order order) throws FindException, DataAccessException Queries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rows, ordered.- Parameters:
startRow
- The first row of the query, which will appear in the returned listendRow
- The last row of the query, which will appear in the returned listcriteria
- The criteria used during the query. Ifnull
, no criteria will be used, every record will be queried.order
- The ordering that will be applied to the query results. Ifnull
, the data will not be ordered.- Returns:
- The list of records that meet the specified filter criteria.
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the user in the specified client has no access to read the data.
-
find
List<Record> find(Client client, int startRow, int endRow, Criteria criteria, Order order) throws FindException, DataAccessException Queries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rows, ordered.- Parameters:
client
- The client that started the query. Ifnull
, the query will happen without checking for access rights.startRow
- The first row of the query, which will appear in the returned listendRow
- The last row of the query, which will appear in the returned listcriteria
- The criteria used during the query. Ifnull
, no criteria will be used, every record will be queried.order
- The ordering that will be applied to the query results. Ifnull
, the data will not be ordered.- Returns:
- The list of records that meet the specified filter criteria.
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the user in the specified client has no access to read the data.
-
find
List<Record> find(int startRow, int endRow, Criteria criteria, Order... orders) throws FindException, DataAccessException Queries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rows, following the specified orders.- Parameters:
startRow
- The first row of the query, which will appear in the returned listendRow
- The last row of the query, which will appear in the returned listcriteria
- The criteria used during the query. Ifnull
, no criteria will be used, every record will be queried.orders
- The orderings that will be applied to the query results. Ifnull
, the data will not be ordered.- Returns:
- The list of records that meet the specified filter criteria.
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the user in the specified client has no access to read the data.
-
find
List<Record> find(Client client, int startRow, int endRow, Criteria criteria, Order... orders) throws FindException, DataAccessException Queries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rows, following the specified orders.- Parameters:
client
- The client that started the query. Ifnull
, the query will happen without checking for access rights.startRow
- The first row of the query, which will appear in the returned listendRow
- The last row of the query, which will appear in the returned listcriteria
- The criteria used during the query. Ifnull
, no criteria will be used, every record will be queried.orders
- The orderings that will be applied to the query results. Ifnull
, the data will not be ordered.- Returns:
- The list of records that meet the specified filter criteria.
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the user in the specified client has no access to read the data.
-
find
List<Record> find(int startRow, int endRow, Criteria criteria, List<Order> orders) throws FindException, DataAccessException Queries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rows, following the specified orders.- Parameters:
startRow
- The first row of the query, which will appear in the returned listendRow
- The last row of the query, which will appear in the returned listcriteria
- The criteria used during the query. Ifnull
, no criteria will be used, every record will be queried.orders
- The list orders that will be applied to the query results. Ifnull
, the data will not be ordered.- Returns:
- The list of records that meet the specified filter criteria.
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the user in the specified client has no access to read the data.
-
find
List<Record> find(Client client, int startRow, int endRow, Criteria criteria, List<Order> orders) throws FindException, DataAccessException Queries the DataDescriptor data synchronously, that meet the specified criteria, between the specified rows, following the specified orders.- Parameters:
client
- The client that started the query. Ifnull
, the query will happen without checking for access rights.startRow
- The first row of the query, which will appear in the returned listendRow
- The last row of the query, which will appear in the returned listcriteria
- The criteria used during the query. Ifnull
, no criteria will be used, every record will be queried.orders
- The list orders that will be applied to the query results. Ifnull
, the data will not be ordered.- Returns:
- The list of records that meet the specified filter criteria.
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the user in the specified client has no access to read the data.
-
fetchData
Fetches data from the DataDescriptor asynchronously.- Parameters:
criteria
- The criteria used for the query. If specified asnull
, every data will be queried.client
- The Client instance, on which the query was started. Ifnull
, the data will be queried without checking for access rightscallback
- The callback implementation- Throws:
IllegalArgumentException
- If the specified callback isnull
-
fetchData
void fetchData(int startRow, int endRow, Criteria criteria, Client client, DataDescriptorCallback callback) Fetches data from the DataDescriptor, between the specified rows, asynchronously.- Parameters:
startRow
- The first row of the query, which will appear in the returned listendRow
- The last row of the query, which will appear in the returned listcriteria
- The criteria used for the query. If specified asnull
, every data will be queried.client
- The Client instance, on which the query was started. Ifnull
, the data will be queried without checking for access rightscallback
- The callback implementation- Throws:
IllegalArgumentException
- If the specified callback isnull
-
fetchData
Fetches data from the DataDescriptor, with the specified order and criteria- Parameters:
criteria
- The criteria used for the query. If specified asnull
, every data will be queried.order
- The ordering instruction used for the query. If specified asnull
, no ordering will be applied.client
- The Client instance, on which the query was started. Ifnull
, the data will be queried without checking for access rightscallback
- The callback implementation- Throws:
IllegalArgumentException
- If the specified callback isnull
-
fetchData
void fetchData(Criteria criteria, List<Order> orders, Client client, DataDescriptorCallback callback) Fetches data from the DataDescriptor, with the specified orders and criteria- Parameters:
criteria
- The criteria used for the query. If specified asnull
, every data will be queried.orders
- The ordering instructions used for the query. If specified asnull
, no ordering will be applied.client
- The Client instance, on which the query was started. Ifnull
, the data will be queried without checking for access rightscallback
- The callback implementation- Throws:
IllegalArgumentException
- If the specified callback isnull
-
fetchData
void fetchData(int startRow, int endRow, Criteria criteria, Order order, Client client, DataDescriptorCallback callback) Fetches data from the DataDescriptor, between the specified rows, with the specified order and criteria- Parameters:
startRow
- The first row of the query, which will appear in the returned listendRow
- The last row of the query, which will appear in the returned listcriteria
- The criteria used for the query. If specified asnull
, every data will be queried.order
- The ordering instruction used for the query. If specified asnull
, no ordering will be applied.client
- The Client instance, on which the query was started. Ifnull
, the data will be queried without checking for access rightscallback
- The callback implementation- Throws:
IllegalArgumentException
- If the specified callback isnull
-
fetchData
void fetchData(int startRow, int endRow, Criteria criteria, List<Order> orders, Client client, DataDescriptorCallback callback) Fetches data from the DataDescriptor, between the specified rows, with the specified orders and criteria- Parameters:
startRow
- The first row of the query, which will appear in the returned listendRow
- The last row of the query, which will appear in the returned listcriteria
- The criteria used for the query. If specified asnull
, every data will be queried.orders
- The ordering instructions used for the query. If specified asnull
, no ordering will be applied.client
- The Client instance, on which the query was started. Ifnull
, the data will be queried without checking for access rightscallback
- The callback implementation- Throws:
IllegalArgumentException
- If the specified callback isnull
-
countData
Counts data in the DataDescriptor- Parameters:
client
- The client that started the query. Ifnull
, the access rights won't be checked when counting.- Returns:
- The counted data of the DataDescriptor
- Throws:
RowCountException
- Occurs if an error was encountered during the execution of the SQL instruction that does the counting.DataAccessException
- Occurs if the logged in user has no read access to the DatDescriptor
-
countData
Counts data in the DataDescriptor, following the specified criteria- Parameters:
criteria
- The criteria used for the query. If specified asnull
, every data will be queried.client
- The Client instance, on which the query was started. Ifnull
, the data will be queried without checking for access rights- Returns:
- The counted data of the DataDescriptor
- Throws:
RowCountException
- Occurs if an error was encountered during the execution of the SQL instruction that does the counting.DataAccessException
- Occurs if the logged in user has no read access to the DataDescriptor
-
save
Saves a record to the DataDescriptor. If the specified record has a unique ID, and record with that ID already exists, it will be overwritten (update), otherwise it will be inserted to the database.- Parameters:
record
- The record that will be saved to the DataDescriptor- Returns:
- The saved record
- Throws:
SaveException
- Occurs if an error was encountered during the saveDataAccessException
- Occurs if the user on the specified client has no permission to save the record to the DataDescriptor.
-
save
Saves a record to the DataDescriptor. If the specified record has a unique ID, and record with that ID already exists, it will be overwritten (update), otherwise it will be inserted to the database.- Parameters:
record
- The record that will be saved to the DataDescriptorclient
- The client, that started the Save. If not specified, the save operation will be executed without checking for access rights.- Returns:
- The saved record
- Throws:
SaveException
- Occurs if an error was encountered during the saveDataAccessException
- Occurs if the user on the specified client has no permission to save the record to the DataDescriptor.
-
save
List<Record> save(Record record, Client client, Transaction transaction) throws SaveException, DataAccessException Saves a record to the DataDescriptor, within the specified database transaction. If the specified record has a unique ID, and record with that ID already exists, it will be overwritten (update), otherwise it will be inserted to the database.- Parameters:
record
- The record that will be saved to the DataDescriptorclient
- The client, that started the Save. If not specified, the save operation will be executed without checking for access rights.transaction
- The object representing the database transaction, on which the save is to be executed. If specified asnull
, the save will happen outside the transaction.- Returns:
- The saved record
- Throws:
SaveException
- Occurs if an error was encountered during the save.DataAccessException
- Occurs if the user on the specified client has no permission to save the record to the DataDescriptor.
-
save
Saves multiple records to the DataDescriptor. If the specified records have a unique ID, and a record with that ID already exists, they will be overwritten (update), otherwise they will be inserted to the database.- Parameters:
records
- A list containing the records to be saved.client
- The client, that started the Save. If not specified, the save operation will be executed without checking for access rights.- Returns:
- The saved record
- Throws:
SaveException
- Occurs if an error was encountered during the save.DataAccessException
- Occurs if the user on the specified client has no permission to save the record to the DataDescriptor.
-
save
List<Record> save(List<Record> records, Client client, Transaction transaction) throws SaveException, DataAccessException Saves multiple records to the DataDescriptor. If the specified records have a unique ID, and a record with that ID already exists, they will be overwritten (update), otherwise they will be inserted to the database.- Parameters:
records
- A list containing the records to be saved.client
- The client, that started the Save. If not specified, the save operation will be executed without checking for access rights.transaction
- The object representing the database transaction, on which the save is to be executed. If specified asnull
, the save will happen outside the transaction.- Returns:
- The saved record
- Throws:
SaveException
- Occurs if an error was encountered during the save.DataAccessException
- Occurs if the user on the specified client has no permission to save the record to the DataDescriptor.
-
save
Saves a record asynchronously to the database. If the specified record has a unique ID, and record with that ID already exists, it will be overwritten (update), otherwise it will be inserted to the database.- Parameters:
record
- The record that will be saved to the DataDescriptorclient
- The client, that started the Save. If not specified, the save operation will be executed without checking for access rights.callback
- The callback implementation
-
save
Saves a record asynchronously to the database, within the specified database transaction. If the specified record has a unique ID, and record with that ID already exists, it will be overwritten (update), otherwise it will be inserted to the database.- Parameters:
record
- The record that will be saved to the DataDescriptorclient
- The client, that started the Save. If not specified, the save operation will be executed without checking for access rights.callback
- The callback implementationtransaction
- The object representing the database transaction, on which the save is to be executed. If specified asnull
, the save will happen outside the transaction.
-
save
Saves a record asynchronously to the database, within the specified database transaction. If the specified record has a unique ID, and record with that ID already exists, it will be overwritten (update), otherwise it will be inserted to the database.- Parameters:
records
- A list containing the records to be saved.client
- The client, that started the Save. If not specified, the save operation will be executed without checking for access rights.callback
- The callback implementation
-
save
void save(List<Record> records, Client client, DataDescriptorCallback callback, Transaction transaction) Saves multiple records asynchronously to the DataDescriptor, within the specified database transaction. If the specified records have a unique ID, and a record with that ID already exists, they will be overwritten (update), otherwise they will be inserted to the database.- Parameters:
records
- A list containing the records to be saved.client
- The client, that started the Save. If not specified, the save operation will be executed without checking for access rights.callback
- The callback implementationtransaction
- The object representing the database transaction, on which the save is to be executed. If specified asnull
, the save will happen outside the transaction.
-
remove
Removes a record from the DataDescriptor- Parameters:
record
- The record to be removed. The record must contain the primary ID. If the record doesn't contain a primary key, no removal will be executed. During the execution, the other data of the record will not be processed.- Returns:
- The removed record
- Throws:
RemoveException
- Occurs if an error was encountered during the removal processDataAccessException
- Occurs if the user on the specified client has no access to write the data of the DataDescriptor.
-
remove
Removes a record from the DataDescriptor- Parameters:
record
- The record to be removed. The record must contain the primary ID. If the record doesn't contain a primary key, no removal will be executed. During the execution, the other data of the record will not be processed.client
- The client that started the removal. If specified asnull
, the removal will be executed without checking for access.- Returns:
- The removed record
- Throws:
RemoveException
- Occurs if an error was encountered during the removal processDataAccessException
- Occurs if the user on the specified client has no access to write the data of the DataDescriptor.
-
remove
List<Record> remove(Record record, Client client, Transaction transaction) throws RemoveException, DataAccessException Removes a record from the DataDescriptor, within the specified transaction.- Parameters:
record
- The record to be removed. The record must contain the primary ID. If the record doesn't contain a primary key, no removal will be executed. During the execution, the other data of the record will not be processed.client
- The client that started the removal. If specified asnull
, the removal will be executed without checking for access.transaction
- The object representing the database transaction, on which the removal is to be executed. If specified asnull
, the removal will happen outside the transaction.- Returns:
- The removed record
- Throws:
RemoveException
- Occurs if an error was encountered during the removal processDataAccessException
- Occurs if the user on the specified client has no access to write the data of the DataDescriptor.
-
remove
List<Record> remove(List<Record> records, Client client) throws RemoveException, DataAccessException Removes multiple records from the DataDescriptor- Parameters:
records
- A list containing the records to be removed. The records must contain a unique ID. If a record has no unique ID, the record will not be removed. The other attributes of the records will not be processed during the removal.client
- The client that started the removal. If specified asnull
, the removal will be executed without checking for access.- Returns:
- The removed record
- Throws:
RemoveException
- Occurs if an error was encountered during the removal processDataAccessException
- Occurs if the user on the specified client has no access to write the data of the DataDescriptor.
-
remove
List<Record> remove(List<Record> records, Client client, Transaction transaction) throws RemoveException, DataAccessException Removes multiple records from the DataDescriptor within the specified transaction- Parameters:
records
- A list containing the records to be removed. The records must contain a unique ID. If a record has no unique ID, the record will not be removed. The other attributes of the records will not be processed during the removal.client
- The client that started the removal. If specified asnull
, the removal will be executed without checking for access.transaction
- The object representing the database transaction, in which the record removal will be executed. If specified asnull
, the removal will happen outside of a transaction- Returns:
- The removed record
- Throws:
RemoveException
- Occurs if an error was encountered during the removal processDataAccessException
- Occurs if the user on the specified client has no access to write the data of the DataDescriptor.
-
remove
Removes a record asynchronously from the DataDescriptor- Parameters:
record
- The record to be removed. The record must contain the primary ID. If the record doesn't contain a primary key, no removal will be executed. During the execution, the other data of the record will not be processed.client
- The client that started the removal. If specified asnull
, the removal will be executed without checking for access.callback
- The callback implementation
-
remove
Removes a record asynchronously from the DataDescriptor, within the specified transaction- Parameters:
record
- The record to be removed. The record must contain the primary ID. If the record doesn't contain a primary key, no removal will be executed. During the execution, the other data of the record will not be processed.client
- The client that started the removal. If specified asnull
, the removal will be executed without checking for access.callback
- The callback implementationtransaction
- The object representing the database transaction, in which the record removal will be executed. If specified asnull
, the removal will happen outside of a transaction
-
remove
Removes multiple records asynchronously from the DataDescriptor- Parameters:
records
- The record to be removed. The record must contain the primary ID. If the record doesn't contain a primary key, no removal will be executed. During the execution, the other data of the record will not be processed.client
- The client that started the removal. If specified asnull
, the removal will be executed without checking for access.callback
- The callback implementation
-
remove
void remove(List<Record> records, Client client, DataDescriptorCallback callback, Transaction transaction) Removes multiple records asynchronously from the DataDescriptor, within the specified transaction- Parameters:
records
- The record to be removed. The record must contain the primary ID. If the record doesn't contain a primary key, no removal will be executed. During the execution, the other data of the record will not be processed.client
- The client that started the removal. If specified asnull
, the removal will be executed without checking for access.callback
- The callback implementationtransaction
- The object representing the database transaction, in which the record removal will be executed. If specified asnull
, the removal will happen outside of a transaction
-
findById
Gets a DataDescriptor record, using the specified ID.- Parameters:
id
- The unique record ID- Returns:
- The record with the specified ID
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the user in the specified client has no access to query the data.
-
findById
Gets a DataDescriptor record, using the specified ID.- Parameters:
client
- The client that started the query. Ifnull
, the query will happen without checking for access rights.id
- The unique record ID- Returns:
- The record with the specified ID
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the user in the specified client has no access to query the data.
-
openTransaction
Transaction openTransaction()
-