Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Re: INSERT statement shouldn't contain column which is NOT NULL with a default value

I figured this was a known issue:

http://www.nabble.com/Workaround-for-Null-Default-Values-to20980805.html#a20980805

I think the behavior here should be to allow the write and put the
onus on the client code to do the refresh in order to update the
entity.



On Fri, Feb 20, 2009 at 11:32 AM, Zarar Siddiqi <zarars@xxxxxxxxx> wrote:
> Hi,
>
> If there's a column defined as NOT NULL with a default value in the
> database and is annotated like so in the entity:
>
> @Column(name="WEIGHT", nullable=false)
> private Float weight;
>
> Shouldn't EclipseLink omit the column from the insert statement in the
> case when its value is null?
>
> Right now DB2 is complaining (and rightfully so) about a null insert
> into a column defined as not null:
>
> Assignment of a NULL value to a NOT NULL column "TBSPACEID=46,
> TABLEID=2, COLNO=7" is not allowed.
>
> Is this a bug or do I have to do something more to make it omit the
> column from the insert statement in this case?
>
> Thanks,
> Zarar
>


Back to the top