Re: equivalent of DbAttribute.isMandatory() for Relationship?

From: Mike Kienenberger (mkienen..laska.net)
Date: Thu Jan 29 2004 - 18:39:11 EST

  • Next message: Scott Ellsworth: "Confusion about writable to-many relationships"

    > On Jan 28, 2004, at 4:52 PM, Mike Kienenberger wrote:
    > > What's the equivalent of DbAttribute.isMandatory() for a Relationship?

    Andrus Adamchik <andru..bjectstyle.org> wrote:
    > There is none. To get down to the source DbAttribute, you will have to
    > go via ObjRelationship.getDbRelationships().

    Wow. Thanks! It took a bit, but I did eventually get there.

    Here's the velocity code for posterity's sake. This assumes a simple join.

    #set ($dbRelationship = $anObjRelationship.getDbRelationships().get(0) )##
    #set ($dbAttributePair = $dbRelationship.getJoins().get(0) )##
    #set ($dbAttribute = $dbAttributePair.getSource() )##

    -Mike



    This archive was generated by hypermail 2.0.0 : Thu Jan 29 2004 - 18:38:22 EST