Reputation: 400
I Have simple question,
I want to set Oracle CURRENT_TIMESTAMP to my JPA entity, I do not want Java to send value.
I tried below but did not work.
@Column(name="TMSP", columnDefinition="TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable=false)
private Timestamp tmsp;
its either inserting null or date I set in java but not the DB date.
Upvotes: 2
Views: 1688
Reputation: 11
You can use
updatable= false
@Column(name="TMSP", updatable= false, columnDefinition="TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable=false)
private Timestamp tmsp;
Upvotes: 1