I am having trouble finding how to map different type of fields for different DBs in a Spring Boot Application. Primarily, I would like to know how to map the MySQL Timestamp but it would be great if I can also find a link to the collection of mappings for every datatype in different DBs.
The list of standard basic types you can find here .
TIMESTAMP
to the following Java 8 types : java.time.Instant
, java.time.LocalDateTime
, java.time.OffsetDateTime
and java.time.ZonedDateTime
.
java.util.Date
(see this ):@Column(name = "`timestamp`")
@Temporal(TemporalType.TIMESTAMP)
private Date timestamp;
But the first approach is much more preferable.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.