I think its a legitimate use case to ask for. It bothers me that it doesn't work. I'd file a bug and use a workaround until its fixed. Explain why its important and the workaround isn't enough when you out in the big.
Are what happens. Worth a shot.
------Original Message------
From: webtier_at_javadesktop.org
To: webtier_at_glassfish.dev.java.net
ReplyTo: webtier_at_glassfish.dev.java.net
Subject: Re: [webtier] Re: 'Attempt to modify an identity column' exception(no Hibetnate)
Sent: Jul 16, 2009 05:08
Of course it would :)
public User(String email, String password) {
this.email = email;
this.password = password;
this.status = 'INACTIVE';
}
or
....
User u = new User(email, password);
u.setStatus('INACTIVE');
em.persist(u);
em.flush();
both would work as well.
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.
I agree I'm being a pain in the a... but I'm just curious :)
[Message sent by forum member 'dziku' (dziku)]
http://forums.java.net/jive/thread.jspa?messageID=355914
---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
Sent from my Verizon Wireless BlackBerry