-
1. Re: How to insert a timestamp to a Not Nullable column from
fhh Apr 5, 2007 6:31 PM (in response to anarinsky)The setter is never called if you don't set the value on the jsf page.
To achieve what you want either use a default on the column value by changing the created database schema or use the @Prepersist annotation.
Regards
Felix -
2. Re: How to insert a timestamp to a Not Nullable column from
anarinsky Apr 5, 2007 9:10 PM (in response to anarinsky)Thank you, great. Prepersist did help.
Still, with above scenario I have the problem with id. It supposed to be auto generated. However, when I add @GeneratedValue I am getting the exception on startup:
ObjectName: persistence.units:ear=spot4.ear,unitName=spot4
State: FAILED
Reason: javax.persistence.PersistenceException: org.hibernate.HibernateException: Missing sequence or table: hibernate_sequence
I Depend On:
jboss.jca:service=DataSourceBinding,name=spot4Datasource
With the old variant of Hibernate this auto sequence generated worked with the following annotation used in Doclet:
/**
* @hibernate.id column="ID" generator-class="increment" unsaved-value="0"
*/
Again, any suggestions? -
3. Re: How to insert a timestamp to a Not Nullable column from
fhh Apr 6, 2007 10:38 AM (in response to anarinsky)I think it is not a good idea to use the generator strategy increment.
Create the sequence insted. If you have already data in the schema, set the initial value of the sequence so you don't get duplicate pks.
Use @SequenceGenerator or alter the sequence manually.
Regards
Felix