Reputation: 6476
I have an entity that has a variable of type LocalTime
and I would like to store it in database. So I have two questions:
I do not care for date at all whatsoever.
Upvotes: 7
Views: 3868
Reputation: 30686
hibernate-java8 provide a LocalTimeType for persist a LocalTime
field.Since hibernate-java8-5.2.+ has been merged into the hibernate-core module.
saving LocalTime
as sql time column.
@Column
private LocalTime time;
saving LocalTime
as sql varchar column.
@Column(columnDefinition = "varchar(8)")
private LocalTime time;
Upvotes: 10