Hi
I've just started using OJB (converting from Castor) and I'm running into
some unexpected behavior.

When I select from the table (using ODMG) the id field is always set to -1
(for SequenceManagerNativeImpl) or the next value in sequence (for
SequenceManagerHighLowImpl). That is the case even when I select for a
specific value for the id column. I'm expecting the id value in the instance
to be the value stored in the database.

I create a table in HSQL like so:
create table category (
 id identity,
 name varchar not null,
 constraint uniq_name unique(name)
)

And I have the repository.xml for this table as:
 <class-descriptor
      class="com.agilitycourses.model.types.Category"  table="category"  >
      <field-descriptor   name="_id"  column="ID" jdbc-type="INTEGER"
         autoincrement="true"  primarykey="true"   />
      <field-descriptor  name="_name"column="NAME" jdbc-type="VARCHAR"  />
   </class-descriptor>

If I drop the table and create it with "id integer not null" or if I change
autoincrement="false" I retrieve the values correctly in my select.

Am I missing something in my configuration? Is this configuration not
supported?
I'd greatly appreciate any pointers.
Thanks
Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to