You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sqlcontainer-nonimplemented.asciidoc 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ---
  2. title: Non-Implemented Methods
  3. order: 8
  4. layout: page
  5. ---
  6. [[sqlcontainer.nonimplemented]]
  7. = Non-Implemented Methods
  8. Due to the database connection inherent to the SQLContainer, some of the methods
  9. from the container interfaces of Vaadin can not (or would not make sense to) be
  10. implemented. These methods are listed below, and they will throw an
  11. [classname]#UnsupportedOperationException# on invocation.
  12. ----
  13. public boolean addContainerProperty(Object propertyId,
  14. Class<?> type,
  15. Object defaultValue)
  16. public boolean removeContainerProperty(Object propertyId)
  17. public Item addItem(Object itemId)
  18. public Object addItemAt(int index)
  19. public Item addItemAt(int index, Object newItemId)
  20. public Object addItemAfter(Object previousItemId)
  21. public Item addItemAfter(Object previousItemId, Object newItemId)
  22. ----
  23. Additionally, the following methods of the [classname]#Item# interface are not
  24. supported in the [classname]#RowItem# class:
  25. ----
  26. public boolean addItemProperty(Object id, Property property)
  27. public boolean removeItemProperty(Object id)
  28. ----
  29. [[sqlcontainer.nonimplemented.getitemids]]
  30. == About the getItemIds() method
  31. To properly implement the Vaadin [classname]#Container# interface, a
  32. [methodname]#getItemIds()# method has been implented in the
  33. [classname]#SQLContainer#. By definition, this method returns a collection of
  34. all the item IDs present in the container. What this means in the
  35. [classname]#SQLContainer# case is that the container has to query the database
  36. for the primary key columns of all the rows present in the connected database
  37. table.
  38. It is obvious that this could potentially lead to fetching tens or even hundreds
  39. of thousands of rows in an effort to satisfy the method caller. This will
  40. effectively kill the lazy loading properties of [classname]#SQLContainer# and
  41. therefore the following warning is expressed here:
  42. [WARNING]
  43. ====
  44. It is highly recommended not to call the [methodname]#getitemIds()# method,
  45. unless it is known that in the use case in question the item ID set will always
  46. be of reasonable size.
  47. ====