Re: Setting Default Values for Entities

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sat Dec 22 2007 - 17:11:53 EST

  • Next message: Adam Yocum: "Re: Setting Default Values for Entities"

    Syncing DB defaults with entities is indeed a painful exercise as JDBC
    provides no callback mechanism to let the app know which defaults were
    set. Here is one more brute force mechanism to achieve that -
    invalidate all newly inserted objects. E.g., using 3.0 API:

    List newObjects = context.newObjects();
    context.commitChanges();
    context.performGenericQuery(new RefreshQuery(newObjects));

    Andrus

    On Dec 22, 2007, at 11:57 PM, Aristedes Maniatis wrote:

    >
    > On 23/12/2007, at 5:30 AM, Adam Yocum wrote:
    >
    >> 'SHOW columns FROM tablename'
    >
    > This might be a good starting point:
    >
    > http://cayenne.apache.org/doc/api/org/apache/cayenne/map/ObjEntity.html#getAttributes()
    >
    > Ari Maniatis
    >
    >
    >
    > -------------------------->
    > ish
    > http://www.ish.com.au
    > Level 1, 30 Wilson Street Newtown 2042 Australia
    > phone +61 2 9550 5001 fax +61 2 9550 4001
    > GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Sat Dec 22 2007 - 17:12:29 EST