Re: SelectQuery and table that is synonym

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Jul 07 2005 - 04:16:05 EDT

  • Next message: Dhruti Ramani: "Re: DataObject states"

    Laila,

    I am replying via cayenne-user - this discussion is a better fit for
    the user list.

    I really can't think of a reason for such behavior, so how about
    trying a few things to debug the JDBC layer. Start by turning on data
    rows fetch and check for differences in values (and keys!) in the
    returned data row maps:

    query.setFetchingDataRows(true);

    This may give some hints...

    Andrus

    On Jul 6, 2005, at 2:28 PM, laila paganelli wrote:

    > Hi,
    >
    > I'm trying to run a SelectQuery on a table that is a synonym of a
    > remote table.
    > I'm using oracle 10.1.0.4 and cayenne 1.2M4 jars.
    >
    > dataContext = DataContext.createDataContext(false);
    > expression = Expression.fromString("name = 'english'");
    > query = new SelectQuery(RawNewsLanguage.class, expression);
    > result = (RawNewsLanguage)dataContext.performQuery(query).get(0);
    >
    > The cayenne query is SELECT t0.NAME, t0.ID_LNG FROM RAWNWSLNG t0 WHERE
    > t0.NAME = ? [bind: 'english']
    >
    > If I run this query on a database with original RAWNWSLNG table, the
    > result is correct
    >
    > {[ name => english
    > ]<oid: com.extrapola.scooter.dataModel.RawNewsLanguage: <ID_LNG:
    > 20>; state: committed>}
    >
    >
    > But if I run the query on a database with RAWNWSLNG like synonym, I
    > have a strange result
    >
    > {[ name => ç
    > ]<oid: com.extrapola.scooter.dataModel.RawNewsLanguage: <ID_LNG: 0>;
    > state: committed>}
    >
    > Where is the problem?
    > How I can run my application on tables that are synonyms?
    >
    > Thanks,
    > Laila
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu Jul 07 2005 - 04:16:07 EDT