Andrus can probably explain this even better, but I should point out
that it literally means that Cayenne will use the pk of the source
object and "push" it to the pk of the destination. Otherwise Cayenne
would try and generate the pk for the destination, causing untold
grief. It is particularly useful when you have some sort of ancillary
table. For example, in Oracle it is only possible to have one BLOB
column per table, and it can make some things quite slow (maybe for
other DB's as well?). So if a Person had a picture (e.g. raw jpeg
data), it might be worth modelling this as a separate PersonPicture
entity. The toPersonPicture relationship from Person would be marked
toDependentPk, because the PersonPicture pk would *always* be the same
as the Person.
Does this help?
Craig
On Thu, 2003-01-16 at 00:02, Bill Fan wrote:
> Michael,
>
> I think I could try to explain it from what I just understood from the
> result of my previous thread - 1:n deletion problem.
>
> If we refer back to this thread, there are Project & ProjectUsers table in
> the database. The related db-relationship and obj-relationship entries from
> the data map xml file are as below:
>
> <db-relationship name="projectusersArray" source="PROJECT"
> target="PROJECTUSERS" toDependentPK="true" toMany="true">
> <db-attribute-pair source="ProjectID" target="ProjectId"/>
> </db-relationship>
>
> <obj-relationship name="projectusersArray" source="Project"
> target="Projectusers" toMany="true" deleteRule="Nullify">
> <db-relationship-ref source="PROJECT" target="PROJECTUSERS"
> name="projectusersArray"/>
> </obj-relationship>
>
> Now the point:
> ==========
> toDependenPK above means the PROJECTUSERS.ProductId value must reference(or
> use) the value of the PROJECT.ProjectId. It represents the FK relationship
> in the database.
>
> Hope this helps.
>
> Bill
>
>
>
>
>
> ----- Original Message -----
> From: "Michael Schuldt" <m..scensys.de>
> To: <cayenne-use..bjectstyle.org>
> Sent: Wednesday, January 15, 2003 6:48 PM
> Subject: To Dep PK?
>
>
> > Hi,
> >
> > could anyone explain what's meant by "To Dep PK" within Cayenne Modeler? I
> > tried to figure out but with no success.
> >
> > Thank you
> >
> > Michael
> >
> >
> >
>
>
This archive was generated by hypermail 2.0.0 : Wed Jan 15 2003 - 14:10:58 EST