|
com.im.df.api 5.9 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface DFResultSet
This object is used for managing data for a particular DFDataTree.
The ResultSet encapsulates a particular snapshot of data for the DataTree. This can be all data, or a subset. The snapshot can be updated by applying a particular query or list of IDs, and the IDs at each position in the DataTree hierarchy can be sorted with custom sort directives.
Views (grid view, form view...) get their data from a particular ResultSet. Multiple views from the same DataTree use the same ResultSet, which means their contents will be coordinated (apply a sort in one view and data in the other view will also be re-sorted accordingly).
The DFResultSet itself does not have much functionality, but provides set of DFResultSet.VertexStates. Each
VertexState then contain the data for one vertex of related DFDataTree. This typically (in database implementation)
means that one VertexState represents data for one database table subset.
To obtain DFResultSet for a particular DFDataTree use DFSchemaDataProvider.getDefaultResultSet(com.im.df.api.ddl.DFDataTree, boolean, com.im.commons.progress.DFEnvironmentRO) method. This
DFResultSet instance is shared. First you need to have DFSchema instance which is the root object (use
DIFUtilities.findSchema(com.im.df.api.ddl.DFItem) to find schema from any DFItem). Then use DFSchema.getDataProvider().
So the final code can look like:
DFDataTree dt = ...;
DFschema schema = DIFUtilities.findSchema(dt);
DFEnvironmentRO env = EnvUtils.createDefaultEnvironmentRO("Loading data", false);
DFResultSet rs = schema.getDataProvider().getDefaultResultSet(dt, true, env);
env.getFeedback().finish();
| Nested Class Summary | |
|---|---|
static interface |
DFResultSet.VertexState
This object represent state of data of one DFDataTree.Vertex. |
| Field Summary | |
|---|---|
static String |
PROP_LAST_EXECUTED_QUERY
|
static String |
PROP_SEARCH_DOMAIN
|
static String |
PROP_WORKING_QUERY
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Register property change listener to be notified about prop. |
void |
applyList(List<? extends Comparable<?>> ids,
DFEnvironmentRW env)
Sets ids on master level of this result set's data tree. |
void |
applyQuery(DFTermExpression term,
DFEnvironmentRW env)
|
void |
applyWorkingQuery(DFEnvironmentRW env)
Apply the current working query to result set. |
DFDataTree |
getDataTree()
Get the DFDataTree which this result set was created for. |
DFTermExpression |
getLastExecutedQuery()
Return the last executed query - the query which was working when applyWorkingQuery(DFEnvironmentRW) was called last time. |
DFLockable |
getLockable()
Get private lockable for modifying this result set's state. |
DFResultSet.VertexState |
getRootVertexState()
Get vertex state for the root vertex. |
DFSearchDomain |
getSearchDomain()
Get the current search domain. |
DFResultSet.VertexState |
getVertexState(DFDataTree.Vertex vertex)
Get the state of this result set for particular vertex from the DFDataTree. |
DFTermExpression |
getWorkingQuery()
Get current working query expression. |
void |
reload(DFEnvironmentRW env)
Reload row ids (primary keys) and data for this DFResultSet. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Unregister property change listener. |
void |
setSearchDomain(DFSearchDomain searchDomain,
DFEnvironmentRW env)
Make a ids constraint for query (only subset of DB table given by domain is searched). |
void |
setWorkingQuery(DFTermExpression workingQuery,
DFEnvironmentRW env)
Set the query which will be used in next applyWorkingQuery(DFEnvironmentRW)
method call. |
| Field Detail |
|---|
static final String PROP_WORKING_QUERY
static final String PROP_LAST_EXECUTED_QUERY
static final String PROP_SEARCH_DOMAIN
| Method Detail |
|---|
DFDataTree getDataTree()
void setWorkingQuery(DFTermExpression workingQuery,
DFEnvironmentRW env)
applyWorkingQuery(DFEnvironmentRW)
method call. The query is called 'working' because it is supposed different visualizations
can cooperate on it's editing - for example query in form, standard query builder, etc.
workingQuery - The working queryenv - The environmentDFTermExpression getWorkingQuery()
DFTermExpression.ALL_DATA constant.
void applyWorkingQuery(DFEnvironmentRW env)
env - The environment
void applyQuery(DFTermExpression term,
DFEnvironmentRW env)
DFTermExpression getLastExecutedQuery()
applyWorkingQuery(DFEnvironmentRW) was called last time.
Never returns null, but instead of null it returns
DFTermExpression.ALL_DATA constant - for example
if applyList was called after last applyWorkingQuery method call.
void applyList(List<? extends Comparable<?>> ids,
DFEnvironmentRW env)
ids - The ids listenv - The environmentvoid reload(DFEnvironmentRW env)
DFEntityDataProvider.reloadData()
for each VertexState's entity of this result set.
env - The environment
void setSearchDomain(DFSearchDomain searchDomain,
DFEnvironmentRW env)
searchDomain - The search domain for this DFResultSet. Never put null as parameter,
use DFSearchDomain.DEFAULT instead.env - The environmentDFSearchDomain getSearchDomain()
DFSearchDomain.DEFAULT is used as domain.
DFLockable getLockable()
DFResultSet.VertexState getVertexState(DFDataTree.Vertex vertex)
vertex -
DFResultSet.VertexState getRootVertexState()
resultSet.getVertexState(resultSet.getDataTree().getRootVertex()) to
resultSet.getRootVertexState().
DFDataTree.Vertex.void addPropertyChangeListener(PropertyChangeListener l)
l - The property change listenervoid removePropertyChangeListener(PropertyChangeListener l)
l - The property change listener
|
com.im.df.api 5.9 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||