Java notes-JPA saves data when the specified column is not inserted and submitted (CURRENT_TIMESTAMP)

Some fields of some tables need to be set to the current time as follows:

If you do not set this value when saving with JPA in Spring Boot, you will be prompted that this value cannot be NULL.

Here only need to make such settings:

@Column(name = "create_time", insertable = false,update = false)

 

Published 1,346 original articles · 10,000+ praises · 4.63 million views

Guess you like

Origin blog.csdn.net/qq78442761/article/details/105624032