The relation title is usually only used if there if more than one
relationship to a particular entity, for example an entity might have two
relationships with the Party entity like FromParty and ToParty with From/To
being the title and Party being the rel-entity-name.
In a lot of cases there is no title so you just use the entity name, such as
in your case below.
Regards
Scott
On 09/10/2007, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> I have this bit of code:
>
> GenericValue payment = delegator.findByPrimaryKey("Payment",
> UtilMisc.toMap("paymentId", paymentId));
> ...
> GenericValue paymentMethod =
> payment.getRelatedOne("PaymentMethod");
>
> The javadoc for getRelatedOne sez:
>
> Parameters:
> relationName - String containing the relation name which is the
> combination of relation.title and relation.rel-entity-name as specified in
> the entity XML definition file.
>
> I did not quite understand this statement as it does not seem to make
> sense
> in this context. Is this parameter a concatination of "Payment" and
> "Method" where Payment is the relation.title and Method is the
> relation.rel-entity-name?
>
> I kinda dont think so. I looked in the entitydef file containg Payment
> and
> found this:
>
> <relation type="one" fk-name="PAYMENT_PMETH"
> rel-entity-name="PaymentMethod">
> <key-map field-name="paymentMethodId"/>
> </relation>
>
> So, I am assuming that this particular getRelatedOne call is going to open
> the PaymentMethod entity and find the related "paymentMethodId" record.
>
> Is this correct?
>
> Also, if I see a yyy.getRelatedOne(xxx), can I assume that xxx is the
> entity
> name to look in and xxxId is the key name in xxx always?
>
> Thanks
>
> Skip
>
>
>