Re: primary column in select query

From: Mike Kienenberger (mkienen..mail.com)
Date: Fri Nov 25 2005 - 11:07:39 EST

  • Next message: Korbinian Bachl: "beginners struggle"

    I think in this particular case you are better off doing one of the
    two following.

    1) adding a meaningless primary key, and making countryCode a standard
    object attribute. This will save you problems for unforseen
    situations later on.

    or

    2) defining your countryCode as an ObjAttribute. You can't use
    auto-pk-generation on this column anyway, so there's no reason not
    make it a standard object attribute.

    It is possible to reference attributes by db:, but I don't know the specifics.

    On 11/25/05, Lothar Krenzien <lkrenzie..eb.de> wrote:
    >
    > Hi there,
    >
    > I have a table which uses a character column with country codes as primary key. Now I want to use this column in a select query. First I tried it this way:
    >
    > ExpressionFactory.matchExp("toTblAddress.toTblCountry.countryCode", searchCriteria.getCountry())
    >
    > This didn't worked because the column is a primary key and not defined in the mapping file. Of course I can define a new (integer) column as primary key, but I would like to know is there a way to use the existing column in a query.
    >
    > Thanks, Lothar
    > ______________________________________________________________
    > Verschicken Sie romantische, coole und witzige Bilder per SMS!
    > Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
    >
    >



    This archive was generated by hypermail 2.0.0 : Fri Nov 25 2005 - 11:07:40 EST