Interface DFSchemaDataProvider
-
public interface DFSchemaDataProvider
The root object for providing data in DIF. Using this object you can get to data providers for entities and for relationships. This class is also used for creating newDFResultSet
s.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
XATTR_TURN_INIT_LOAD
Property in schema schema for turning of initial data loading.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description DFDataTreeDataProvider
getDataTreeDataProvider(DFDataTree dataTree)
GetsDFDataTreeDataProvider
for the specific data tree.DFResultSet
getDefaultResultSet(DFDataTree dataTree, boolean showAll, com.im.commons.progress.DFEnvironmentRO env)
Gets theDFResultSet
for the givenDFDataTree
.DFEntityDataProvider
getEntityDataProvider(DFEntity entity)
DFRelationDataProvider
getRelationshipDataProvider(DFRelationship.Direction relationshipDir)
DFSchema
getSchema()
boolean
hasDefaultResultSet(DFDataTree dataTree)
Tests if the the DFResultSet for the given DataTree is already created.DFUpdateInfo
insert(DFInsertDescription data, com.im.commons.progress.DFEnvironmentRO env)
Inserts complex data into one or more entities.com.google.common.collect.Table<java.lang.Comparable<?>,java.lang.String,java.lang.Object>
queryForData(DFDataTree.Vertex masterVertex, java.util.List<? extends DFField> fields, java.util.List<? extends java.lang.Comparable<?>> rowIds)
Deprecated.com.chemaxon.ijc.commons.datarequest.api.RelationalData
queryForData(DFDataTree.Vertex masterVertex, java.util.List<? extends java.lang.Comparable<?>> masterRowIds, java.util.List<? extends DFField> fields, com.im.commons.progress.DFEnvironmentRO env)
Fetchesfields
values identified byrowIds
.java.util.List<? extends java.lang.Comparable<?>>
queryForIds(DFDataTree dataTree, DFTermExpression query, SortDirective sort, EarlyResultsConsumer consumer, com.im.commons.progress.DFEnvironmentRO env)
Gets the IDs (primary key values) of the root entity of the provided data tree that matches the specified query.java.util.List<? extends java.lang.Comparable<?>>
queryForIds(DFEntity entity, DFDataTree dataTree, DFTermExpression query, SortDirective sort, EarlyResultsConsumer consumer, com.im.commons.progress.DFEnvironmentRO env)
Gets the IDs (primary key values) of the provided entity that matches the specified query.
-
-
-
Field Detail
-
XATTR_TURN_INIT_LOAD
static final java.lang.String XATTR_TURN_INIT_LOAD
Property in schema schema for turning of initial data loading.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSchema
DFSchema getSchema()
- Returns:
- the schema which this data provider belongs to
-
getEntityDataProvider
DFEntityDataProvider getEntityDataProvider(DFEntity entity)
- Parameters:
entity
- whose data we want to manipulate- Returns:
- the EDP (entity data provider) for the specified entity.
-
getDataTreeDataProvider
DFDataTreeDataProvider getDataTreeDataProvider(DFDataTree dataTree)
GetsDFDataTreeDataProvider
for the specific data tree. This can be used for editing multiple rows in once or to performing update of relational data in the data tree.- Parameters:
dataTree
- The data tree.- Returns:
- The data provider.
- Since:
- 15.7.27
-
getRelationshipDataProvider
DFRelationDataProvider getRelationshipDataProvider(DFRelationship.Direction relationshipDir)
- Returns:
- the relation data provider for the specified relationship direction.
-
getDefaultResultSet
DFResultSet getDefaultResultSet(DFDataTree dataTree, boolean showAll, com.im.commons.progress.DFEnvironmentRO env)
Gets theDFResultSet
for the givenDFDataTree
.Note: The default in the name of this method has historical reasons and should be ignored. Better name would be just getResultSet.
- Parameters:
dataTree
- The data treeshowAll
- Iftrue
result set will contain all IDs of the master entity, iffalse
it will contain no rows. Important: This parameter has only reason when new result set is created during this call. If someone else has called this method for the sameDFDataTree
before it has no effect.
-
hasDefaultResultSet
boolean hasDefaultResultSet(DFDataTree dataTree)
Tests if the the DFResultSet for the given DataTree is already created.Note: The default in the name of this method has historical reasons and should be ignored. Better name would be isResultSetReady.
- Parameters:
dataTree
- The datatree which should be tested- Returns:
true
ifDFResultSet
was already created by same previousgetDefaultResultSet(com.im.df.api.ddl.DFDataTree, boolean, com.im.commons.progress.DFEnvironmentRO)
method call;false
otherwise.
-
insert
DFUpdateInfo insert(DFInsertDescription data, com.im.commons.progress.DFEnvironmentRO env)
Inserts complex data into one or more entities. It is possible to specify values for different entities connected by relationships in order to satisfy integrity constraints.For simple insertions, use the
DFEntityDataProvider
. SeeDFInsertDescription
documentation for more details- Parameters:
data
- The instructions what to insertenv
- The environment- Returns:
- information about the update
-
queryForIds
java.util.List<? extends java.lang.Comparable<?>> queryForIds(DFDataTree dataTree, DFTermExpression query, SortDirective sort, EarlyResultsConsumer consumer, com.im.commons.progress.DFEnvironmentRO env)
Gets the IDs (primary key values) of the root entity of the provided data tree that matches the specified query.Some types of queries support reading of partials results (IDs) before the query is entirely processed. See the allied method for more details.
- Parameters:
dataTree
- TheDFDataTree
that allows the different fields to be resolved to formulate the queryquery
- The query Elements can be from other entities in theDFDataTree
, for empty query useDFTermExpression.ALL_DATA
constant.sort
- The sort directivesconsumer
- Early results consumer provided by caller used by query engine to call back partial results. If it'snull
then no partial results are reported back.env
- environment for reading data- Returns:
- The values of the ID field of the entity that match the query
-
queryForIds
java.util.List<? extends java.lang.Comparable<?>> queryForIds(DFEntity entity, DFDataTree dataTree, DFTermExpression query, SortDirective sort, EarlyResultsConsumer consumer, com.im.commons.progress.DFEnvironmentRO env)
Gets the IDs (primary key values) of the provided entity that matches the specified query.Some types of queries support reading of partials results (IDs) before the query is entirely processed. In such cases, an instance of
EarlyResultsConsumer
can be provided, which allows reading of partial results during a query execution. If query execution engine is unable to provide partial results for the given query, then theEarlyResultsConsumer.addNewResult(java.lang.Comparable<?>)
is never called. Which types of queries support partial results is an implementation detail. Thus API client cannot rely on the early results functionality which serves as an optimization technique only.All query terms must be from the same data tree.
- Parameters:
entity
- the entity to be taken as rootdataTree
- The data tree that allows the different fields to be resolved to formulate the queryquery
- The query Elements can be from other entities in the datatree, for empty query useDFTermExpression.ALL_DATA
constant.sort
- The sort directivesconsumer
- Early results consumer provided by caller used by query engine to call back partial results. If it'snull
then no partial results are reported back.env
- environment for reading data- Returns:
- The values of the ID field of the entity that match the query
- Since:
- 15.12.14 throws
QueryExecutionException
when there is something wrong with data retrieval. Before that such problems were only logged and swallowed.
-
queryForData
@Deprecated com.google.common.collect.Table<java.lang.Comparable<?>,java.lang.String,java.lang.Object> queryForData(DFDataTree.Vertex masterVertex, java.util.List<? extends DFField> fields, java.util.List<? extends java.lang.Comparable<?>> rowIds)
Deprecated.Fetchesfields
values in records identified byrowIds
. ThemasterVertex
's entity ID field is queried for therowIds
to determine the records. Thefields
can belong to any entity that is reachable by1:1
orN:1
relationship from themasterVertex
's entity (transitively) and that belongs to the same datatree. Please note that themasterVertex
can be any vertex within a datatree and not necessarily the datatree's root vertex.- Parameters:
masterVertex
- TheDFDataTree.Vertex
to query for records. TherowIds
are applied against its ID field.fields
- The list of fields for which data are fetched.rowIds
- The values ofmasterVertex
's ID field. These IDs effectively determine what rows are fetched.- Returns:
- The data table -- ordered pair of keys (row id, field id) mapped to a field value.
- Since:
- 6.4
-
queryForData
com.chemaxon.ijc.commons.datarequest.api.RelationalData queryForData(DFDataTree.Vertex masterVertex, java.util.List<? extends java.lang.Comparable<?>> masterRowIds, java.util.List<? extends DFField> fields, com.im.commons.progress.DFEnvironmentRO env)
Fetchesfields
values identified byrowIds
. ThemasterVertex
's entity ID field is queried for therowIds
to determine the records. Thefields
can belong to any entity that is reachable by1:1
orN:1
relationship from themasterVertex
's entity (transitively) and that belongs to the same datatree. Please note that themasterVertex
can be any vertex within a datatree and not necessarily the datatree's root vertex.- Parameters:
masterVertex
- TheDFDataTree.Vertex
to query for records. TherowIds
are applied against its ID field.fields
- The list of fields for which data are fetched.masterRowIds
- The values ofmasterVertex
's ID field. These IDs effectively determine what rows are fetched.env
- environment used for progress reporting and cancelling the data fetching. Cancellation policy is up to the individual implementations.- Returns:
- data for all requested fields
- Since:
- 16.7.11
-
-