openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fay Wang <fyw...@yahoo.com>
Subject Re: Passing Current Timestamp to Entity Object's Timestamp field variable
Date Wed, 30 Jun 2010 19:58:41 GMT
Hi,
   
      A workaround is to do the insert first with automatically generated timestamp and then
update it with the application-provided timestamp. In order to do so, you need to remove updatable=false
from the Column annotation.

@Entity
@Table(name = "INVOICE", schema = "SALES")
public class 
Invoice implements Serializable {

  @Id
   private int id;

  private String description;

   
@Column(columnDefinition="Timestamp NOT NULL WITH DEFAULT", insertable= 
false)
    private java.sql.Timestamp ts;






----- Original Message ----
From: Arnav-A <arnav216@gmail.com>
To: dev@openjpa.apache.org
Sent: Wed, June 30, 2010 11:46:17 AM
Subject: Re: Passing Current Timestamp to Entity Object's Timestamp field variable


Still Waiting for the answer.

Please reply
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/Passing-Current-Timestamp-to-Entity-Object-s-Timestamp-field-variable-tp5232583p5238118.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.



      


Mime
View raw message