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 gb...@catsoft.de on 2006/01/31 19:00:17 UTC

ArrayIndexOutOfBoundsException at 1:N relationship

Hi,

I have a problem with a java.lang.ArrayIndexOutOfBoundsException: 1

I have the following:

class A
{ 
Integer pkA
};

class B
{
Integer pkA // is PK
Integer pkB // is PK too
Integer otherField;
};

B has 2 primary key fields and A only one.
So the first field pkA of Class (and table ) B is the primary key of 
Class (and table) A.
>From point of view of  A it is a 1:N relationship. I have a repository
with a collection descriptor at
A and a reference descriptor at B and both are working when I turn on
autoload.
I would like to query A and get all A where B.otherField=SomeValue.
This produces the ArrayIndexOutOfBoundsException. Can the problem be that
B has no own
pk field so that B.pkA is part of the primary key of the table B and part
of a reference descriptor
(and part of the collection descriptor of A) ?

best regards,

Guido

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


Re: ArrayIndexOutOfBoundsException at 1:N relationship

Posted by Guido Beutler <GB...@cat-gmbh.de>.
Hi,

please forget all I wrote :)
I had a error at the definition of the pk of A. A second row was defined 
as primary key too.
I think that I ran in this problem during my tests. This maybe why the 
autoload was working
when I started. With the invalid pk definition the test case wouldn't 
succeed

best regards,

Guido

gbeutler@catsoft.de wrote:

>Hi,
>
>I have a problem with a java.lang.ArrayIndexOutOfBoundsException: 1
>
>I have the following:
>
>class A
>{ 
>Integer pkA
>};
>
>class B
>{
>Integer pkA // is PK
>Integer pkB // is PK too
>Integer otherField;
>};
>
>B has 2 primary key fields and A only one.
>So the first field pkA of Class (and table ) B is the primary key of 
>Class (and table) A.
>>>From point of view of  A it is a 1:N relationship. I have a repository
>with a collection descriptor at
>A and a reference descriptor at B and both are working when I turn on
>autoload.
>I would like to query A and get all A where B.otherField=SomeValue.
>This produces the ArrayIndexOutOfBoundsException. Can the problem be that
>B has no own
>pk field so that B.pkA is part of the primary key of the table B and part
>of a reference descriptor
>(and part of the collection descriptor of A) ?
>
>best regards,
>
>Guido
>
>  
>


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