Re: Newbie, retrieving list from specific class DataObjects

From: Tore Halset (halse..vv.ntnu.no)
Date: Fri Feb 06 2004 - 09:05:27 EST

  • Next message: Andrus Adamchik: "Re: Transaction confirmation."

    On Feb 6, 2004, at 13:49, Nenko Ivanov wrote:

    > Hi all. I am newbie in Cayenne.
    > My application need is all the data from the database to be loaded
    > into memory at application start.
    > So I have one static DataContex and load it using 
    >  
    > SelectQuery query = new SelectQuery(SomeClass.class);
    > dataContext.performQuery(query);
    > ............. // some similar queries
    >  
    > The loaded data is relational and everything works file for me.
    > But it looks logic for me to have method that retrieves all the
    > DataObjects from DataContex that
    > are instances of some specific DataObject subclass.

    Are you able to keep one List for every DataObject subclass?

    SelectQuery query = new SelectQuery(Apple.class);
    List apples = dataContext.performQuery(query);
    .......... // some similar queries

      - Tore.



    This archive was generated by hypermail 2.0.0 : Fri Feb 06 2004 - 09:05:41 EST