|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface EntityContainer<T>
A Container for EntityItems. The data is provided by a
EntityProvider. Supports sorting, advanced filtering, nested
properties and buffering.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.vaadin.data.Container |
|---|
com.vaadin.data.Container.Editor, com.vaadin.data.Container.Filter, com.vaadin.data.Container.Filterable, com.vaadin.data.Container.Hierarchical, com.vaadin.data.Container.Indexed, com.vaadin.data.Container.ItemSetChangeEvent, com.vaadin.data.Container.ItemSetChangeListener, com.vaadin.data.Container.ItemSetChangeNotifier, com.vaadin.data.Container.Ordered, com.vaadin.data.Container.PropertySetChangeEvent, com.vaadin.data.Container.PropertySetChangeListener, com.vaadin.data.Container.PropertySetChangeNotifier, com.vaadin.data.Container.SimpleFilterable, com.vaadin.data.Container.Sortable, com.vaadin.data.Container.Viewer |
| Nested classes/interfaces inherited from interface com.vaadin.addon.jpacontainer.AdvancedFilterable |
|---|
AdvancedFilterable.FiltersAppliedEvent<C extends com.vaadin.data.Container & AdvancedFilterable> |
| Nested classes/interfaces inherited from interface com.vaadin.data.Buffered |
|---|
com.vaadin.data.Buffered.SourceException |
| Method Summary | |
|---|---|
void |
addContainerFilter(Object propertyId,
String filterString,
boolean ignoreCase,
boolean onlyMatchPrefix)
|
Object |
addEntity(T entity)
Adds a new entity to the container. |
void |
addNestedContainerProperty(String nestedProperty)
Adds the nested property nestedProperty to the set of
properties. |
EntityItem<T> |
createEntityItem(T entity)
Creates a new EntityItem for entity without adding
it to the container. |
Class<T> |
getEntityClass()
Gets the class of the entities that are/can be contained in this container. |
EntityProvider<T> |
getEntityProvider()
Gets the entity provider that is used for fetching and storing entities. |
EntityItem<T> |
getItem(Object itemId)
|
PropertyKind |
getPropertyKind(Object propertyId)
|
QueryModifierDelegate |
getQueryModifierDelegate()
Gets the QueryModifierDelegate set for this container. |
boolean |
isAutoCommit()
Alias of Buffered#isWriteThrough() . |
boolean |
isReadOnly()
Returns whether the container is read only or writable. |
void |
refresh()
Refreshes the entire container from the database. |
void |
refreshItem(Object itemId)
Causes all EntityItems created from this container and identified by given entityId to be refreshed. |
void |
removeContainerFilters(Object propertyId)
|
void |
setAutoCommit(boolean autoCommit)
Alias of Buffered#setWriteThrough(boolean) . |
void |
setEntityProvider(EntityProvider<T> entityProvider)
Sets the entity provider to use for fetching and storing entities. |
void |
setReadOnly(boolean readOnly)
Changes the read only state of the container, if possible. |
| Methods inherited from interface com.vaadin.data.Container.Sortable |
|---|
getSortableContainerPropertyIds, sort |
| Methods inherited from interface com.vaadin.data.Container.Ordered |
|---|
addItemAfter, addItemAfter, firstItemId, isFirstId, isLastId, lastItemId, nextItemId, prevItemId |
| Methods inherited from interface com.vaadin.data.Container |
|---|
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItemIds, getType, removeAllItems, removeContainerProperty, removeItem, size |
| Methods inherited from interface com.vaadin.addon.jpacontainer.AdvancedFilterable |
|---|
applyFilters, getAppliedFilters, getFilterablePropertyIds, getFilters, hasUnappliedFilters, isApplyFiltersImmediately, isFilterable, setApplyFiltersImmediately |
| Methods inherited from interface com.vaadin.data.Container.ItemSetChangeNotifier |
|---|
addItemSetChangeListener, addListener, removeItemSetChangeListener, removeListener |
| Methods inherited from interface com.vaadin.data.Buffered |
|---|
commit, discard, isBuffered, isModified, setBuffered |
| Methods inherited from interface com.vaadin.data.Container.Filterable |
|---|
addContainerFilter, getContainerFilters, removeAllContainerFilters, removeContainerFilter |
| Method Detail |
|---|
EntityProvider<T> getEntityProvider()
void setEntityProvider(EntityProvider<T> entityProvider)
entityProvider - the entity provider to use (must not be null).Class<T> getEntityClass()
void addNestedContainerProperty(String nestedProperty)
throws UnsupportedOperationException,
IllegalArgumentException
nestedProperty to the set of
properties. An asterisk can be used as a wildcard to indicate all
leaf-properties.
For example, let's say there is a property named address and
that this property's type in turn has the properties street,
postalCode and city.
If we want to be able to access the street property directly, we can add
the nested property address.street using this method.
However, if we want to add all the address properties, we can also use
address.*. This will cause the nested properties
address.street, address.postalCode and
address.city to be added to the set of properties.
Note, that the wildcard cannot be used in the middle of a chain of
property names. E.g. myprop.*.something is illegal.
Nested properties may be transient, but only persistent nested properties (i.e. embedded properties or ManyToOne references) may be used for filtering or sorting.
nestedProperty - the nested property to add (must not be null).
UnsupportedOperationException - if nested properties are not supported by the container.
IllegalArgumentException - if nestedProperty is illegal.
Object addEntity(T entity)
throws UnsupportedOperationException,
IllegalStateException
EntityItem
can then be accessed by calling getItem(java.lang.Object) using
the entity identifier returned by this method.
If isAutoCommit() is activated, the returned identifier is
always the actual entity ID. Otherwise, the returned identifier may,
depending on the ID generation strategy, be either the actual entity ID
or a temporary ID that is changed to the real ID once the changes have
been committed using Buffered.commit().
entity - the entity to add (must not be null).
UnsupportedOperationException - if the container does not support adding new entities at all.
IllegalStateException - if the container supports adding entities, but is currently
in read only mode.EntityItem<T> createEntityItem(T entity)
EntityItem for entity without adding
it to the container. This makes it possible to use the same
Form for editing both new entities and existing
entities.
To add the entity to the container, addEntity(java.lang.Object)
should be used.
entity - the entity for which an item should be created.
EntityItem.getItemId()EntityItem<T> getItem(Object itemId)
getItem in interface com.vaadin.data.Containerboolean isReadOnly()
void setReadOnly(boolean readOnly)
throws UnsupportedOperationException
readOnly - true to make the container read only, false to make it
writable.
UnsupportedOperationException - if the read only state cannot be changed.
void setAutoCommit(boolean autoCommit)
throws com.vaadin.data.Buffered.SourceException,
com.vaadin.data.Validator.InvalidValueException
Buffered#setWriteThrough(boolean) .
com.vaadin.data.Buffered.SourceException
com.vaadin.data.Validator.InvalidValueExceptionboolean isAutoCommit()
Buffered#isWriteThrough() .
void addContainerFilter(Object propertyId,
String filterString,
boolean ignoreCase,
boolean onlyMatchPrefix)
This method creates a new StringComparisonFilter for the
specified parameters and applies the filter immediately, regardless of
the state of AdvancedFilterable.isApplyFiltersImmediately().
AdvancedFilterable.applyFilters()void removeContainerFilters(Object propertyId)
The container is updated immediately regardless of the state of
AdvancedFilterable.isApplyFiltersImmediately().
PropertyKind getPropertyKind(Object propertyId)
propertyId -
void refreshItem(Object itemId)
itemId - EntityItem.refresh()void refresh()
QueryModifierDelegate getQueryModifierDelegate()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||