Current best-practice workaround would probably be to set the default
values in a pre-persist listener, rather than in the constructor.
Robert
On Oct 1, 2008, at 10/112:01 PM , Andrey Razumovsky wrote:
Hello,
It seems DB column default values are not supported in Cayenne. This
is no
good, and even worse, I cannot setup those values at database level,
because
Cayenne will nullify them anyways - InsertBatchQueryBuilder creates
insert
for all DbAttributes. I think that if we support max-length and
scale, we
should support this too. BTW, I was told Hibernate supports this
feature.
At best we should have that property in DbAttribute and use it along
DB
engineering and reverse-engineering. Of course this is no easy task,
because
we have different types of attributes, e.g. dates (I mean modeler
support
here).
Currently the best way to workaround seems to be setting default
values in
constructor.
What do you think?