Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JPA. How to ignore some field only on merge operation

I would like to have fields: creationDate and updateDate in Entity,

I would like to this fields to be updated in db on persist operation. But I would like to field creationDate will not be updated on merge operation in db.

I am looking for JPA annotation like this: @TransientOnMerge or @IgnoreOnMerge But cant find anything.

Is it possible? Can You help?

like image 406
masterdany88 Avatar asked Apr 24 '15 08:04

masterdany88


1 Answers

you can add @Column(updatable=false) to the field of the entity.

like image 152
PWC Avatar answered Sep 19 '22 16:09

PWC