insert « Default « JPA Q&A





1. Populating an optional property with a database 'default value' insert?    stackoverflow.com

I have a column in a database which defaults to a certain value (1 in my case) when the corresponding property is not set (null). When I do a save/insert with hibernate, ...

2. Default Value - Exclude from INSERT    forum.hibernate.org

I am a pretty much a new user of Hibernate (though I have used it but this was long time ago). Now I get to use it again. This is probably an easy (newbie) question. I have MS SQL 2005 as RDBMS. I have in one table a column called LastModifiedDate of type datetime. It is non-null column and it has ...

3. Inserting null as default values    forum.hibernate.org

I recently upgraded MySQL to 4.1 to take advantage of subselects. It seemd that my application was working fine, but all of a sudden my columns that are declared not-null no longer use a default value when null is inserted. I just get a "cannot be null" error. I read that explicitly inserting null causes an error, while leaving the column ...

4. how insert the default value for a property    forum.hibernate.org

Hi - I was wondering how to do this for timestamp fields? When I insert/update a row in a table, I want a timestamp field to be updated with the current database timestamp i.e. effectively something like: insert into mytable (id,thetime) values (1,NOW()) and update mytable set thetime = NOW() where id = 1 I do not want to use the ...

5. Insert :: "Field 's_subjectId' doesn't have a default v    forum.hibernate.org

Hi I'm a newbie to hibernate, The stack I'm using is Webwork+SpringIOC+Spring-hibernate(hibernate 3) + mysql 5.0 I get an error message while performing an insert into the table [list=]"Field 's_subjectId' doesn't have a default value"[/list] Any help would be appreciated Hibernate version: 3 Mapping documents: s_subjectId ...

6. Insert :: "Field 's_subjectId' doesn't have a default v    forum.hibernate.org

Hi I'm a newbie to hibernate, The stack I'm using is Webwork+SpringIOC+Spring-hibernate(hibernate 3) + mysql 5.0 I get an error message while performing an insert into the table [list=]"Field 's_subjectId' doesn't have a default value"[/list] Any help would be appreciated Hibernate version: 3 Mapping documents: s_subjectId ...