How do I write JPA QL statements that hints to the runtime to use the DEFAULT value ?

Posted by Jacques René Mesrine on Stack Overflow See other posts from Stack Overflow or by Jacques René Mesrine
Published on 2010-05-11T14:44:19Z Indexed on 2010/05/11 15:14 UTC
Read the original article Hit count: 306

Filed under:
|
|
|

I have a table like so:

mysql> show create table foo;
CREATE TABLE foo
(
    network bigint NOT NULL,
    activeDate datetime NULL default '0000-00-00 00:00:00',
    ...
)

In the domain object, FooVO the activeDate member is annotated as Temporal. If I don't set activeDate to a valid Date instance, a new record is inserted with NULLs. I want the default value to take effect if I don't set the activeDate member. Thanks.

© Stack Overflow or respective owner

Related posts about jpa

Related posts about mysql