Skip to main content

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

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