I am working on a Java EE project using Netbeans. I automatically generated the Entities and JPA Controllers using the database.
I want to now update the Database by adding more tables or updating existing ones. Problem I run into is that I have to re-generate all the Entities and JPA Controllers -- which I do not wish to as most of my entities are modified to include
insertable = false, updatable = false
in the @Column
where the database uses current_timestamp
. If I regenerate them, I'll have to modify all the entities again to include the insertable = false, updatable = false
.
This is what I am trying to achieve after creation.
@Column(name = "CREATED_ON", insertable = false, updatable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date createdOn;