db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agssa.net>
Subject Re: SECUENCE of PostgreSQL increment value if use QueryByIdentity and getObjectByQuery
Date Wed, 12 Jan 2005 23:46:24 GMT
Hi:

We are trying to fix this problem:

Using QueryByIdentity is the key is set to null, then the sequence manager
is activated. Here is the snapshot of the code:

    Client c = new Client();
    c.setCli_id(null);         /* <--- Set the key to null */
    Query query = new QueryByIdentity(c);
    Client N = (Client) pb.getObjectByQuery(query);

Here is the repo.xml of the Client c:

<class-descriptor class="my.package.Cliente" table="CLIENTE">
  <field-descriptor name="cli_id"
                    primarykey="true"
                    nullable="false"
                    default-fetch="true"
                    autoincrement="true"
                    sequence-name="cliente_cli_id_seq"
                    column="CLI_ID"
                    jdbc-type="INTEGER"/>
  <field-descriptor name="cli_nombre"
                    nullable="false"
                    default-fetch="true"
                    column="CLI_NOMBRE"
                    jdbc-type="VARCHAR"/>
</class-descriptor>

Why this code retrieve a nextVal from the given sequence manager. Is this
a bug?

Please confirm id this is a bug and we will try to fix it. ;-)

BTW, we are using OBJ_1_0_RELEASE from the CVS (few minuts ago).

Best Regards,

Antonio Gallardo.


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message