Hi matz,

Thank you for your prompt answer.

Best,
Ricardo.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 07, 2003 12:11 PM
To: [EMAIL PROTECTED]
Subject: ID Values in field-descriptor and RE:
getFieldDescriptorByIndex()


Hello,

> -----Original Message-----
> When I retrieve a spec, the aJob_type field has a null value. 
> I debugged and
> saw that method 
> ObjectReferenceDescriptor.getForeignKeyFieldDescriptors()
> works fine. The problem seems to be in the method
> ClassDescriptor.getFieldDescriptorByIndex(int index). Its 
> implementation
> returns the descriptor at position (index - 1), instead of 
> index. When I

I have run into the same problem.  My explanation is:
the current implementation works correctly only if the 
field-descriptor id's are consecutive and 1-based.
(In my situation, they were not consecutive, in yours they
are 0-based.)

If I am right, this is also a contribution to the thread
"ID Values in field-descriptor" started by mailto:[EMAIL PROTECTED]:

> I am trying to determine the rules for allocating the IDs in the
> field-descriptor for the repository.xml, particularly with references and
> collections. These are the rules I have determined so far:
> 1) An ID must be unique within a table.
> 2) The IDs in the table do not need to be contiguous. There may be gaps in
> the sequence.

I doubt the last one.
[..]

> change this implementation to return 
> m_FieldDescriptions[index], everything
> works fine.

This fix would brake all examples, since they have 1-base 
field-descriptor id's.  I would prefer a solution that allows
for non-consecutive ids.  Alternatively, we might just wait for
Oleg's feature, which makes the id superflous.  IMO, that would be 
optimal.

I suggest you just increment all ids at the moment.

> My repository.xml states the following:
> 
> <class-descriptor
>   class="uol.job.store.Job_specification"
>   table="JOB_SCHEDULER.JOB_SPECIFICATION">
> 
>   <field-descriptor id="0"
                        ^^^^^
>     name="iDT_JOB_SPECIFICATION"
>     column="IDT_JOB_SPECIFICATION"
>     jdbc-type="BIGINT"
>     primarykey="true"
>   />
>   <field-descriptor id="1"
                       ^^^^^^^
>     name="iDT_JOB_TYPE"
>     column="IDT_JOB_TYPE"
>     jdbc-type="BIGINT"
>   />

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

Reply via email to