I have similar issue to this.There is no solution there and I am not working with JSON mapping.
LocalTime.parse on time string is removing second part. I have put the test code below. Any suggestion?
public class LocalTimeIssue {
public static void main(String[] args) {
Time someSQLTimeWithZero = new Time(1715264820000L); //09:27:00
printTime(someSQLTimeWithZero); //09:27
Time someSQLTimeWithNoZero = new Time(1715264821000L); //09:27:01
printTime(someSQLTimeWithNoZero); //09:27:01
}
private static void printTime(Time someSQLTime) {
String strTime = someSQLTime.toString();
LocalTime someLocalTime = LocalTime.parse(strTime, DateTimeFormatter.ofPattern("HH:mm:ss"));
System.out.println(someLocalTime);
}
}