You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Joerg Lensing <in...@softcon-lensing.de> on 2003/03/04 16:34:19 UTC

1-1-Mapping: Referenced field must be primaryKey???

Hi,
junit: Article - Produktgroup
Article holds an ID from Productgroup. In the  example it is the 
primaryKey from table Kategorien.
Can I use different field for it?

i get the message:

WARN: OJB broker could not materialize ....AbstractPersistent{1332}

The number shown is the fieldvalue i want to use for referencing the 
productgroup.
But the IndirectionHanler uses the primaryKey (which in my case can't fit)

joerg



Re: 1-1-Mapping: Referenced field must be primaryKey???

Posted by Joerg Lensing <in...@softcon-lensing.de>.
Thomas Mahler schrieb:

> Hi Joerg,
>
> Joerg Lensing wrote:
>
>> Hi,
>> junit: Article - Produktgroup
>> Article holds an ID from Productgroup. In the  example it is the 
>> primaryKey from table Kategorien.
>
>
> foreign keys from one table alway reference primary keys of another 
> (or the same in case of self-join) table.
>
>> Can I use different field for it?
>
>
> only by declaring it as primary key in the repository.
>
> Thomas
>
>>
>> i get the message:
>>
>> WARN: OJB broker could not materialize ....AbstractPersistent{1332}
>>
>> The number shown is the fieldvalue i want to use for referencing the 
>> productgroup.
>> But the IndirectionHanler uses the primaryKey (which in my case can't 
>> fit)
>>
>> joerg
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
hi thomas,
is the primary key in the repository allways primary key of the 
database-table?
or do they only have to be unique values?

joerg



Re: 1-1-Mapping: Referenced field must be primaryKey???

Posted by Thomas Mahler <th...@web.de>.
Hi Joerg,

Joerg Lensing wrote:
> Hi,
> junit: Article - Produktgroup
> Article holds an ID from Productgroup. In the  example it is the 
> primaryKey from table Kategorien.

foreign keys from one table alway reference primary keys of another (or 
the same in case of self-join) table.

> Can I use different field for it?

only by declaring it as primary key in the repository.

Thomas

> 
> i get the message:
> 
> WARN: OJB broker could not materialize ....AbstractPersistent{1332}
> 
> The number shown is the fieldvalue i want to use for referencing the 
> productgroup.
> But the IndirectionHanler uses the primaryKey (which in my case can't fit)
> 
> joerg
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
>