[jboss-user] [EJB 3.0] - how to use timestamp

john_woo@canada.com do-not-reply at jboss.com
Wed Aug 1 22:58:00 EDT 2007


Hi,

I'm using mssql for jboss ejb 3, I've tried

	@Column(name="my_date")
	@Temporal(TemporalType.TIMESTAMP)
	private java.util.Date  myDate;
     // or private java.sql.Timestamp

or 	@Column(name="my_date")
	private Date  creatingDate;

mapping to a table with timestamp column my_date

but when persist this entity, without setDate, got

Cannot insert an explicit value into a timestamp column. Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column

the my_date is nullable, desn't need a value.

Can anyone tell me how to fix it?

Thanks
John

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069876#4069876

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069876



More information about the jboss-user mailing list