Re: Relationship inspection

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sat Dec 01 2007 - 06:52:35 EST

  • Next message: Tore Halset: "Re: cayenne modeler problem on windows"

    There's no direct API to achieve that, but you can still figure it
    from mapping metadata. Check whether a DbAttribute on the to-many side
    of the relationship (i.e. the foreign key) allows null. There are a
    few exceptions from this rule [1], but generally this should be an
    indicator of whether a given to-one is optional.

    You can get access to the mapping metadata in runtime via
    context.getEntityResolver().

    Andrus

    [1] http://objectstyle.org/cayenne/lists/cayenne-user/2007/11/0097.html

    On Dec 1, 2007, at 3:50 AM, Jean-François Smigielski wrote:
    > Hello, list!
    >
    > I am using Cayenne 3.0M1 on top of a Sun JVM 6.0 (I vote for java
    > 1.5 at
    > least support:).
    >
    > Is it possible to determine, from the application point of view, if
    > the
    > to-one side of a "1-*" relationship accept NULL values?
    >
    > --
    > JF Smigielski



    This archive was generated by hypermail 2.0.0 : Sat Dec 01 2007 - 06:53:15 EST