Ah thanks, yes it seems that I triggered this a while ago (cannot really
remember that).
Actually I see one clear advantage.
With the paginators, of myfaces for instance (dont know if the RI also has one)
you do not need the @page and nextPage() definition as in the examples
the final example probably would look like this:
anonymous wrote :
| @Name("bookingList")
| @NamedQuery(name="userBookingList",
| ejbql="from Booking b where b.user = :user order by b.checkinDate")
|
| @QueryFactory(variable="bookings",
| query="userBookingList",
| context="bookingDatabase")
|
| public class BookingListAction implements Serializable
| {
|
| @In @Parameter
| private User user;
|
| @PageSize
| private int pageSize = 100;
| @Page
| private int page = 0;
|
| @DataModelSelection
| private Booking booking;
|
|
| public String cancel()
| booking.cancel();
| return null;
| }
|
You can omit the page holders and data model
definitions in the seam backend bean /session bean entirely
Also there is no explicit paging code
since the paginators increment the internal data model
positional counter automatically
or differently:
anonymous wrote :
|
| @Name("bookingList")
| public class BookingListAction implements Serializable
| {
|
| @In @Parameter
| private User user;
|
| @DataModelQuery("bookingmodel")
| private Query bookingQuery;
|
| @PageSize
| private int pageSize = 100;
| @Page
| private int page = 0;
|
| @DataModelSelection
| private Booking booking;
|
| private String queryParam;
|
| public dosearch() {
| //change the query here according to the query params
| }
|
| public String cancel()
| booking.cancel();
| return null;
| }
| ...
| setters and getters for the query params here
|
|
Advantage in both cases, no navigational code,
in the second case only the query has to be defined
the counter position still can be injected.
Advantage in all of those cases, you only keep one page
of objects maximum in ram, which is a clear advantage to keeping
an entire (and possibly huge) collection of proxy or non proxy objects in ram.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3913696#3913696
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3913696
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user