-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: update of table with GENERATED ALWAYS FOR EACH ROW ON UPDATE
PostPosted: Wed Sep 29, 2010 11:20 am 
Newbie

Joined: Thu Apr 22, 2010 2:25 pm
Posts: 6
I have a table with a column field updatetime which has been defined as auto generate on update,

When i try to update i get error stating cannot set value of auto generated column,

Is there any annotation to do so???

The column is defined like this

LASTCHANGEDATE FOR COLUMN LSTCHGDATE TIMESTAMP GENERATED ALWAYS FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP NOT NULL ,

I have a model like this

@XmlRootElement(name = "MyTable")
@Entity
@Table(name = "MYTABLE")
@Path("/")
public class MyTable {

private java.util.Date lASTCHANGEDATE;

public void setLASTCHANGEDATE(java.util.Date _lASTCHANGEDATE) {
this.lASTCHANGEDATE = _lASTCHANGEDATE;
}

@XmlElement(name = "LASTCHANGEDATE")
@Column(name = "LASTCHANGEDATE")
public java.util.Date getLASTCHANGEDATE() {
return this.lASTCHANGEDATE;
}
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.