webtier@glassfish.java.net

Re: [webtier] Re: 'Attempt to modify an identity column' exception(no Hibetnate)

From: Jim Driscoll <Jim.Driscoll_at_Sun.COM>
Date: Fri, 17 Jul 2009 15:38:25 -0700

On 7/16/09 5:23 AM, lincolnbaxter_at_gmail.com wrote:
> I just wanted to know how to make the container omit the value of the [i]status[/i] field in the entity while creating an insert statement. In this way I wanted to make the database itself insert the default value defined in the table definition. That's what the default values are defined for. There's no use defining a column with its default value when you still need to set this value in the entity.

It may be a bug - or, since this feature is listed in the docs as
database/implementation specific, it may simply not be supported for
your database, or at all in the implementation. If the first, there's
nothing to be done - if the second, it's a feature request, if the
third, it's a feature request verging on a bug.

Have you tried manually doing the insert on your database, to see if it
works without the status value? If it doesn't, then you've found out
why this won't work in JPA.

Jim