r/SpringBoot • • Apr 21 '26

Question Mapping LocalTime via JPA/Hibernate??

Hey folks!

I currently need to use LocalTime as a time field in my entity.
The issue is that while writing Flyway scripts, I realized I’m not sure which SQL type to use for both PostgreSQL and Oracle. I need to standardize the schema so it works across both databases.

What would you suggest as the best solution in this case?

7 Upvotes

12 comments sorted by

View all comments

1

u/[deleted] May 01 '26

[removed] — view removed comment

1

u/ishaqhaj May 01 '26

Currently what i have done is I have created a converter LocalTime and String that implements AttributeConverter interface Store them in DB with Varchar and localTime in Java

1

u/[deleted] May 01 '26

[removed] — view removed comment

1

u/ishaqhaj May 01 '26

Thanks buddy! You’re the man! I’ll test and get back to you