RE: Pagination query

From: Joel Trunick (joel.trunic..ebifysolutions.com)
Date: Wed Feb 23 2005 - 17:23:23 EST

  • Next message: Joćo Paulo Vasconcellos: "Re: Cayenne and Caché"

    I just did this the other day with Cayenne. An excellent example of
    Cayenne being better than Hibernate! Especially with the Tapestry table
    component. Very few lines of code, and very productive.

    J

    -----Original Message-----
    From: Sami Mohammed [mailto:SMOHAMME..ndependenthealth.com]
    Sent: Wednesday, February 23, 2005 1:13 PM
    To: cayenne-use..bjectstyle.org
    Subject: RE: Pagination query

    You don't really need the ComplexHandler and the ComplexHanderImpl. The
    ComplexHandler is an interface and the ComplexHandlerImpl is the Cayenne

    implementation. You just need to subclass the bean I sent. Use it like:

      // New Query (usually part of an implementation)
      SelectQuery qry = new SelectQuery (Complex.class);

      // Set the pagesize (amount of records shown on your page)
      qry.setPageSize(pPageSize.intValue());

      // Add some ordering
      qry.addOrdering("code", Ordering.ASC);
      qry.addOrdering("subcomplex", Ordering.ASC);

      // Get stuff
      List lst = mContext.performQuery(qry);

    Regards, Laszlo



    This archive was generated by hypermail 2.0.0 : Wed Feb 23 2005 - 17:23:25 EST