|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.data.util.QueryContainer
@Deprecated public class QueryContainer
The QueryContainer
is the specialized form of Container which is
Ordered and Indexed. This is used to represent the contents of relational
database tables accessed through the JDBC Connection in the Vaadin Table.
This creates Items based on the queryStatement provided to the container.
The QueryContainer
can be visualized as a representation of a
relational database table.Each Item in the container represents the row
fetched by the query.All cells in a column have same data type and the data
type information is retrieved from the metadata of the resultset.
Note : If data in the tables gets modified, Container will not get reflected
with the updates, we have to explicity invoke QueryContainer.refresh method.
refresh()
Container
,
Serialized FormField Summary | |
---|---|
static int |
DEFAULT_RESULTSET_CONCURRENCY
Deprecated. |
static int |
DEFAULT_RESULTSET_TYPE
Deprecated. |
Constructor Summary | |
---|---|
QueryContainer(String queryStatement,
Connection connection)
Deprecated. Constructs new QueryContainer with the specified
queryStatement using the default resultset type and default resultset
concurrency. |
|
QueryContainer(String queryStatement,
Connection connection,
int resultSetType,
int resultSetConcurrency)
Deprecated. Constructs new QueryContainer with the specified
queryStatement . |
Method Summary | |
---|---|
boolean |
addContainerProperty(Object propertyId,
Class<?> type,
Object defaultValue)
Deprecated. Adds new Property to all Items in the Container. |
Object |
addItem()
Deprecated. Creates a new Item into the Container, and assign it an ID. |
Item |
addItem(Object itemId)
Deprecated. Creates new Item with the given ID into the Container. |
Object |
addItemAfter(Object previousItemId)
Deprecated. Adds new item after the given item. |
Item |
addItemAfter(Object previousItemId,
Object newItemId)
Deprecated. Adds new item after the given item. |
Object |
addItemAt(int index)
Deprecated. Adds item at the position of provided index in the container. |
Item |
addItemAt(int index,
Object newItemId)
Deprecated. Adds the given item at the position of given index. |
void |
close()
Deprecated. Releases and nullifies the statement . |
boolean |
containsId(Object id)
Deprecated. Tests if the list contains the specified Item. |
void |
finalize()
Deprecated. Closes the statement. |
Object |
firstItemId()
Deprecated. Returns id of first item in the Container. |
Property |
getContainerProperty(Object itemId,
Object propertyId)
Deprecated. Gets the property identified by the given itemId and propertyId from the container. |
Collection<String> |
getContainerPropertyIds()
Deprecated. Gets the collection of propertyId from the Container. |
Object |
getIdByIndex(int index)
Deprecated. Gets the Index id in the container. |
Item |
getItem(Object id)
Deprecated. Gets the Item with the given Item ID from the Container. |
Collection<?> |
getItemIds()
Deprecated. Gets an collection of all the item IDs in the container. |
Class<?> |
getType(Object id)
Deprecated. Gets the data type of all properties identified by the given type ID. |
int |
indexOfId(Object id)
Deprecated. Gets the index of the Item corresponding to id in the container. |
boolean |
isFirstId(Object id)
Deprecated. Returns true if given id is first id at first index. |
boolean |
isLastId(Object id)
Deprecated. Returns true if given id is last id at last index. |
Object |
lastItemId()
Deprecated. Returns id of last item in the Container. |
Object |
nextItemId(Object id)
Deprecated. Returns id of next item in container at next index. |
Object |
prevItemId(Object id)
Deprecated. Returns id of previous item in container at previous index. |
void |
refresh()
Deprecated. Restores items in the container. |
boolean |
removeAllItems()
Deprecated. Removes all Items from the Container. |
boolean |
removeContainerProperty(Object propertyId)
Deprecated. Removes a Property specified by the given Property ID from the Container. |
boolean |
removeItem(Object itemId)
Deprecated. Removes the Item identified by ItemId from the Container. |
int |
size()
Deprecated. Gets the number of items in the container. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_RESULTSET_TYPE
public static final int DEFAULT_RESULTSET_CONCURRENCY
Constructor Detail |
---|
public QueryContainer(String queryStatement, Connection connection, int resultSetType, int resultSetConcurrency) throws SQLException
QueryContainer
with the specified
queryStatement
.
queryStatement
- Database queryconnection
- Connection objectresultSetType
- resultSetConcurrency
-
SQLException
- when database operation failspublic QueryContainer(String queryStatement, Connection connection) throws SQLException
QueryContainer
with the specified
queryStatement using the default resultset type and default resultset
concurrency.
queryStatement
- Database queryconnection
- Connection object
SQLException
- when database operation failsDEFAULT_RESULTSET_TYPE
,
DEFAULT_RESULTSET_CONCURRENCY
Method Detail |
---|
public void refresh() throws SQLException
Restores items in the container. This method will update the latest data to the container.
Note: This method should be used to update the container with the latest items.
SQLException
- when database operation failspublic void close() throws SQLException
statement
.
SQLException
- when database operation failspublic Item getItem(Object id)
getItem
in interface Container
id
- ID of the Item to retrieve
public Collection<String> getContainerPropertyIds()
getContainerPropertyIds
in interface Container
public Collection<?> getItemIds()
getItemIds
in interface Container
public Property getContainerProperty(Object itemId, Object propertyId)
null
is returned.
getContainerProperty
in interface Container
itemId
- ID of the Item which contains the PropertypropertyId
- ID of the Property to retrieve
null
otherwise.public Class<?> getType(Object id)
getType
in interface Container
id
- ID identifying the Properties
public int size()
size
in interface Container
public boolean containsId(Object id)
containsId
in interface Container
id
- ID the of Item to be tested.
true
if given id is in the container;
false
otherwise.public Item addItem(Object itemId) throws UnsupportedOperationException
addItem
in interface Container
itemId
- ID of the Item to be created.
null
if it fails.
UnsupportedOperationException
- if the addItem method is not supported.public Object addItem() throws UnsupportedOperationException
addItem
in interface Container
null
if it fails.
UnsupportedOperationException
- if the addItem method is not supported.public boolean removeItem(Object itemId) throws UnsupportedOperationException
removeItem
in interface Container
itemId
- ID of the Item to remove.
true
if the operation succeeded; false
otherwise.
UnsupportedOperationException
- if the removeItem method is not supported.public boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue) throws UnsupportedOperationException
addContainerProperty
in interface Container
propertyId
- ID of the Propertytype
- Data type of the new PropertydefaultValue
- The value all created Properties are initialized to.
true
if the operation succeeded; false
otherwise.
UnsupportedOperationException
- if the addContainerProperty method is not supported.public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException
removeContainerProperty
in interface Container
propertyId
- ID of the Property to remove
true
if the operation succeeded; false
otherwise.
UnsupportedOperationException
- if the removeContainerProperty method is not supported.public boolean removeAllItems() throws UnsupportedOperationException
removeAllItems
in interface Container
true
if the operation succeeded; false
otherwise.
UnsupportedOperationException
- if the removeAllItems method is not supported.public Item addItemAfter(Object previousItemId, Object newItemId) throws UnsupportedOperationException
addItemAfter
in interface Container.Ordered
previousItemId
- Id of the previous item in ordered container.newItemId
- Id of the new item to be added.
null
if the operation fails.
UnsupportedOperationException
- if the addItemAfter method is not supported.Ordered: adding items in filtered or sorted containers
public Object addItemAfter(Object previousItemId) throws UnsupportedOperationException
addItemAfter
in interface Container.Ordered
previousItemId
- Id of the previous item in ordered container.
null
if the
operation fails.
UnsupportedOperationException
- if the addItemAfter method is not supported.Ordered: adding items in filtered or sorted containers
public Object firstItemId()
firstItemId
in interface Container.Ordered
public boolean isFirstId(Object id)
true
if given id is first id at first index.
isFirstId
in interface Container.Ordered
id
- ID of an Item in the Container.
true
if the Item is first visible item in the
Container, false
if notpublic boolean isLastId(Object id)
true
if given id is last id at last index.
isLastId
in interface Container.Ordered
id
- ID of an Item in the Container
true
if the Item is last visible item in the
Container, false
if notpublic Object lastItemId()
lastItemId
in interface Container.Ordered
public Object nextItemId(Object id)
nextItemId
in interface Container.Ordered
id
- ID of an Item in the Container.
public Object prevItemId(Object id)
prevItemId
in interface Container.Ordered
id
- ID of an Item in the Container.
public void finalize()
finalize
in class Object
close()
public Item addItemAt(int index, Object newItemId) throws UnsupportedOperationException
addItemAt
in interface Container.Indexed
index
- Index to add the new item.newItemId
- Id of the new item to be added.
null
if the operation fails.
UnsupportedOperationException
- if the addItemAt is not supported.public Object addItemAt(int index) throws UnsupportedOperationException
addItemAt
in interface Container.Indexed
index
- Index to add the new item.
null
if the operation
fails.
UnsupportedOperationException
- if the addItemAt is not supported.public Object getIdByIndex(int index)
getIdByIndex
in interface Container.Indexed
index
- Index Id.
public int indexOfId(Object id)
indexOfId
in interface Container.Indexed
id
- ID of an Item in the Container
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |