|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EntityTableModel
Specifies a table model containing Entity objects
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jminor.common.model.FilteredTableModel |
---|
FilteredTableModel.SortingState |
Method Summary | |
---|---|
void |
addEntitiesByPrimaryKeys(List<Entity.Key> primaryKeys,
boolean atFront)
Retrieves the entities identified by the given primary keys and adds them to this table model |
void |
deleteSelected()
Deletes the selected entities |
StateObserver |
getBatchUpdateAllowedState()
|
EntityEditModel |
getEditModel()
Returns the edit model associated with this table model, throws a RuntimeExcption in case no edit model has been associated with this table model |
List<Entity> |
getEntitiesByPrimaryKeys(List<Entity.Key> keys)
Finds entities according to the values in keys |
Collection<Entity> |
getEntitiesByPropertyValues(Map<String,Object> values)
Finds entities according to the values of propertyValues |
Entity |
getEntityByPrimaryKey(Entity.Key primaryKey)
|
int |
getFetchCount()
Returns the maximum number of records to fetch via the underlying query, by default this returns -1, meaning all records should be fetched |
List<Entity.Key> |
getPrimaryKeysOfSelectedEntities()
|
Color |
getPropertyBackgroundColor(int row,
Property columnProperty)
|
PropertySummaryModel |
getPropertySummaryModel(Property property)
Returns the PropertySummaryModel associated with the given property |
PropertySummaryModel |
getPropertySummaryModel(String propertyID)
Returns the PropertySummaryModel associated with the property identified by propertyID |
ReportDataWrapper |
getReportDataSource()
Returns an initialized ReportDataWrapper instance, the default implementation returns null. |
EntityTableSearchModel |
getSearchModel()
|
Iterator<Entity> |
getSelectedEntitiesIterator()
Returns an Iterator which iterates through the selected entities |
Map<String,Collection<Entity>> |
getSelectionDependencies()
|
SortingDirective |
getSortingDirective(String propertyID)
|
String |
getStatusMessage()
|
List<Property> |
getTableColumnProperties()
|
Collection<Object> |
getValues(Property property,
boolean selectedOnly)
|
boolean |
hasEditModel()
|
int |
indexOf(Entity.Key primaryKey)
|
boolean |
isBatchUpdateAllowed()
|
boolean |
isDeleteAllowed()
|
boolean |
isDetailModel()
|
boolean |
isQueryConfigurationAllowed()
|
boolean |
isQueryCriteriaRequired()
|
boolean |
isReadOnly()
|
boolean |
isUpdateAllowed()
|
void |
replaceEntities(Collection<Entity> entities)
Replaces the given entities in this table model |
void |
replaceForeignKeyValues(String foreignKeyEntityID,
Collection<Entity> newForeignKeyValues)
For every entity in this table model, replaces the foreign key instance bearing the primary key with the corresponding entity from foreignKeyValues , useful when property
values have been changed in the referenced entity that must be reflected in the table model. |
EntityTableModel |
setBatchUpdateAllowed(boolean batchUpdateAllowed)
|
EntityTableModel |
setDetailModel(boolean detailModel)
|
void |
setEditModel(EntityEditModel editModel)
Associates the given edit model with this table model, this enables delete/update functionality via this table model as well as enabling it to react to delete events in the edit model. |
EntityTableModel |
setFetchCount(int fetchCount)
Sets the maximum number of records to fetch via the underlying query, a value of -1 means all records should be fetched |
void |
setForeignKeySearchValues(String referencedEntityID,
List<Entity> referenceEntities)
Refreshes this table model according the the given values by finding the first foreign key property referencing the entity identified by referencedEntityID and setting referenceEntities
as the criteria values. |
EntityTableModel |
setQueryConfigurationAllowed(boolean value)
Specifies whether or not the underlying query should be configurable |
EntityTableModel |
setQueryCriteriaRequired(boolean value)
|
EntityTableModel |
setReportDataSource(ReportDataWrapper reportDataSource)
Sets the report data source to use during report generation |
void |
setSelectedByPrimaryKeys(List<Entity.Key> keys)
Sets the selected entities according to the primary keys in primaryKeys |
void |
setSortingDirective(String propertyID,
SortingDirective directive,
boolean addColumnToSort)
|
void |
update(List<Entity> entities)
Updates the given Entities. |
Methods inherited from interface org.jminor.common.model.FilteredModel |
---|
addFilteringListener, contains, filterContents, getAllItems, getFilterCriteria, getFilteredItemCount, getFilteredItems, getVisibleItemCount, getVisibleItems, isFiltered, isVisible, removeFilteringListener, setFilterCriteria |
Methods inherited from interface javax.swing.table.TableModel |
---|
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from interface org.jminor.common.model.Refreshable |
---|
clear, refresh |
Methods inherited from interface org.jminor.framework.client.model.EntityDataProvider |
---|
getConnectionProvider, getEntityID |
Method Detail |
---|
EntityEditModel getEditModel()
setEditModel(EntityEditModel)
boolean hasEditModel()
void setEditModel(EntityEditModel editModel)
editModel
- the edit model to associate with this table modeldeleteSelected()
,
update(java.util.List)
EntityTableModel setDetailModel(boolean detailModel)
detailModel
- if set to true then this table model will not run a query unless a query criteria has been specified
setQueryCriteriaRequired(boolean)
void setForeignKeySearchValues(String referencedEntityID, List<Entity> referenceEntities)
referencedEntityID
and setting referenceEntities
as the criteria values. If no foreign key property is found this method has no effect.
referencedEntityID
- the ID of the master entityreferenceEntities
- the entities to use as criteria valuesisDetailModel()
void replaceForeignKeyValues(String foreignKeyEntityID, Collection<Entity> newForeignKeyValues)
foreignKeyValues
, useful when property
values have been changed in the referenced entity that must be reflected in the table model.
foreignKeyEntityID
- the entity ID of the foreign key valuesnewForeignKeyValues
- the foreign key entitiesvoid addEntitiesByPrimaryKeys(List<Entity.Key> primaryKeys, boolean atFront)
primaryKeys
- the primary keysatFront
- if true the entities are added to the frontvoid replaceEntities(Collection<Entity> entities)
entities
- the entities to replaceboolean isQueryConfigurationAllowed()
EntityTableModel setQueryConfigurationAllowed(boolean value)
value
- the value
EntityTableSearchModel getSearchModel()
boolean isDetailModel()
boolean isDeleteAllowed()
boolean isReadOnly()
setEditModel(EntityEditModel)
boolean isUpdateAllowed()
boolean isBatchUpdateAllowed()
EntityTableModel setBatchUpdateAllowed(boolean batchUpdateAllowed)
batchUpdateAllowed
- true if this model should allow multiple entities to be updated at a time
PropertySummaryModel getPropertySummaryModel(String propertyID)
propertyID
propertyID
- the ID of the property
PropertySummaryModel getPropertySummaryModel(Property property)
property
- the property
Color getPropertyBackgroundColor(int row, Property columnProperty)
row
- the row for which to retrieve the background colorcolumnProperty
- the column property for which to retrieve the background color
Entity.Definition.setBackgroundColorProvider(org.jminor.framework.domain.Entity.BackgroundColorProvider)
,
EntityTableCellRenderer
List<Property> getTableColumnProperties()
String getStatusMessage()
int getFetchCount()
EntityTableModel setFetchCount(int fetchCount)
fetchCount
- the fetch count
Map<String,Collection<Entity>> getSelectionDependencies()
void update(List<Entity> entities) throws CancelException, ValidationException, DatabaseException
entities
- the Entities to update
DatabaseException
- in case of a database exception
CancelException
- in case the user cancels the operation
RecordModifiedException
- in case an entity was modified by another user
ValidationException
- in case validation failsEntity.Validator.validate(java.util.Collection, int)
void deleteSelected() throws CancelException, DatabaseException
DatabaseException
- in case of a database exception
CancelException
- in case the user cancels the operationboolean isQueryCriteriaRequired()
EntityTableModel setQueryCriteriaRequired(boolean value)
value
- if set to true then all underlying entities are shown
when no criteria is applied, which can be problematic in the case of huge datasets.
List<Entity> getEntitiesByPrimaryKeys(List<Entity.Key> keys)
keys
keys
- the primary key values to use as condition
keys
void setSelectedByPrimaryKeys(List<Entity.Key> keys)
primaryKeys
keys
- the primary keys of the entities to selectCollection<Entity> getEntitiesByPropertyValues(Map<String,Object> values)
propertyValues
values
- the property values to use as condition mapped
to their respective propertyIDs
properties
Iterator<Entity> getSelectedEntitiesIterator()
getReportDataSource()
List<Entity.Key> getPrimaryKeysOfSelectedEntities()
ReportDataWrapper getReportDataSource()
getSelectedEntitiesIterator()
EntityTableModel setReportDataSource(ReportDataWrapper reportDataSource)
reportDataSource
- the data source
Collection<Object> getValues(Property property, boolean selectedOnly)
property
- the property for which to retrieve the valuesselectedOnly
- if true only values from the selected entities are returned
property
from the entities in the table modelEntity getEntityByPrimaryKey(Entity.Key primaryKey)
primaryKey
- the primary key to search by
int indexOf(Entity.Key primaryKey)
primaryKey
- the primary key
void setSortingDirective(String propertyID, SortingDirective directive, boolean addColumnToSort)
propertyID
- the propertyIDdirective
- the sorting directiveaddColumnToSort
- if false then the sorting state is cleared, otherwise
this column is added to the sorted column set according to getSortingPriority()
SortingDirective getSortingDirective(String propertyID)
propertyID
- the propertyID
StateObserver getBatchUpdateAllowedState()
isBatchUpdateAllowed()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |