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 Christopher C Worley <cw...@ensystex.com> on 2003/09/05 21:57:02 UTC
Extent problem with multiple classes and tables
I have been successfull at handling mapping extents (two classes to two
tables). Whe I add a third class I get "assertValidPkFields failed for
Object of type..." error.
What i have is A -> B -> C. The primary key for A i have setup with
autoincrement=true, B and C i do not so i does not screw up the primary
keys. I think the problem in PersistenceBrokerImpl.storeToDb() is when
it validates the PKs, C.id is null so it updates the referenceFKs. When
it does this it only looks at the B reference which is null. So, I get
this error. I think it should also set fk references for A, if so then
the PK would autoincrement. To test this i also added autoincrement to
B class descriptor and i did not get this error; however, my PK's where
wrong because A also autoincremented.
Is there somthing else i need to set in my class descriptors.
-chris worley
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Extent problem with multiple classes and tables
Posted by Christopher C Worley <cw...@ensystex.com>.
Still having problems with this. I have a question about defining
extents. In the below explination would C be the only class I would
have to define the extent classes for or would it be in A?
<class-descriptor class="C">
...
<extent-class class-ref="A"/>
<extent-class class-ref="B"/>
</class-descriptor>
-chris worley
>
> I have been successfull at handling mapping extents (two classes to
> two tables). Whe I add a third class I get "assertValidPkFields
> failed for Object of type..." error.
> What i have is A -> B -> C. The primary key for A i have setup with
> autoincrement=true, B and C i do not so i does not screw up the
> primary keys. I think the problem in
> PersistenceBrokerImpl.storeToDb() is when it validates the PKs, C.id
> is null so it updates the referenceFKs. When it does this it only
> looks at the B reference which is null. So, I get this error. I
> think it should also set fk references for A, if so then the PK would
> autoincrement. To test this i also added autoincrement to B class
> descriptor and i did not get this error; however, my PK's where wrong
> because A also autoincremented.
>
> Is there somthing else i need to set in my class descriptors.
>
> -chris worley
>
>
> ---------------------------------------------------------------------
> 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