I’m evaluating the usage of JpaContainer.
In a typical architecture dao/services are layers which helps to organize code but in JpaContainer they seems to be non needed anymore : very good.
However some in such layers is usually inserted the solution of some not trivial problems, like pagination.
Very often is not required to read all data (“Items”) for a table but just the quantity needed to show a single screen (say 20 rows) and then, using prev/next buttons navigate to other pages.
Is it possible to implement it wit JpaContainer ?
How ?
Tks
Tullio
Hi,
Yes this is possible, and already built into JPAContainer. The Table component, for instance, is lazy loading by default, which means that it will only load N items from the container at a time and it is up to the container to support this. The main logic is in the Table class and JPAContainer works through the Container API to provide data lazily.
Using something like
the PagedTable addon
you can get a table with paging, that loads data lazily from the container.
HTH,
/Jonatan