Re: Querying based on 1/2 the compound key

From: Joshua Pyle (joshua.t.pyl..mail.com)
Date: Tue May 24 2005 - 19:33:30 EDT

  • Next message: Fredrik Liden: "RE: Querying based on 1/2 the compound key"

    What is the exception ?

    Most likely you will need to create a "db" epression if the 2 primary
    key fields do not have accessors defined in the modeler/xml.

    I also notice that in your expression you note KEY and not KEY1 or KEY2.

    An example expression might be...
    Expression exp = ExpressionFactory.matchDbExp(TEST.KEY2,"1111");

    This is assuming that the variable TEST.KEY2 contains the database
    field name for that part of the primary key.

    -- 
    Joshua T. Pyle
    Go has always existed.
    

    On 5/24/05, Fredrik Liden <flide..ranslate.com> wrote: > I have one table with a compound key (key1,key2). > > Now I'm trying to retreive all the entries from this table/object TEST > where say key2="1111". > > If I use an expression like this: > Expression exp = ExpressionFactory.matchExp(TEST.KEY,"1111"); > SelectQuery query = new SelectQuery(TEST.class,exp); > I get an exception. > > Using the DataObjectUtils object I could probably get 1 unique object if > I populate it with a key map. > But how can I get a list if I just want to match one part of the > compound key? > > Thanks, > > Fredrik >



    This archive was generated by hypermail 2.0.0 : Tue May 24 2005 - 19:33:31 EDT