Re: Auto generated column, how to not insert null

From: Jürgen Saar (jsaa..eb.de)
Date: Sun Jan 16 2005 - 05:46:18 EST

  • Next message: Andrus Adamchik: "Re: Auto generated column, how to not insert null"

    For my point of view, all should be done in cayenne DataObject.
    This is the only way to be database independent.

    So the workaround mentioned by Andrus,
    is not really a workaround ... it is the better way

    Andrus Adamchik <andru..bjectstyle.org> schrieb am 16.01.05 03:32:08:
    >
    > Hi Mike,
    >
    > I am currently working on finalizing the auto-generated columns code.
    > This should be released in the next 1.2 milestone. I will still need to
    > test it with default column values. I wonder if the mechanism for value
    > retrieval of "default" columns is the same as for generated keys (as in
    > addition to skipping such columns in INSERT we need to pass default
    > value back to the object on commit)...
    >
    > For now I guess the workaround is to set this property explicitly to a
    > non-null value, e.g. in validateForInsert() or in
    > setPersistenceState().
    >
    > Andrus
    >
    >
    > On Jan 15, 2005, at 7:07 PM, Mike D Pilsbury wrote:
    > > I have a column that is defined as having a default value (actually
    > > CURRENT_TIMESTAMP, but it shouldn't matter). When I create a new
    > > object, and it gets committed, the generated INSERT sets the column to
    > > null. But this obviously stops the database from using the default
    > > value.
    > >
    > > So what I want to know is how do I configure Cayenne so that it
    > > ignores the column for INSERTs and UPDATEs, but gets it for selects? I
    > > tried setting the column to Auto (isGenerated), but that appears to
    > > have no effect. I know that Hibernate supports this. so I don't doubt
    > > that Cayenne does too.
    > >
    > > I am a newbie to Cayenne, so I am sure that it is something simple
    > > that I am not finding, despite searching the docs and the mailing
    > > list.
    > >
    > > Mike

    ______________________________________________________________
    Verschicken Sie romantische, coole und witzige Bilder per SMS!
    Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193



    This archive was generated by hypermail 2.0.0 : Sun Jan 16 2005 - 05:46:31 EST