SELECT * FROM ep53 ORDER BY TimeValue LIMIT {0},{1}
import java.time.LocalDate;
import java.util.List;
class Scratch {
public static void main(String[] args) {
var souvenirs = List.of(
new Souvenir("2", LocalDate.of(2000, 1, 1)),
new Souvenir("1", LocalDate.of(1999, 1, 1))
);
var souvenirsSorted = souvenirs.stream()
.sorted(Scratch::compareSouvenirs)
.toList();
System.out.println(souvenirsSorted);
}
private static int compareSouvenirs(Souvenir souvenir1, Souvenir souvenir2) {
return souvenir1.date.compareTo(souvenir2.date);
}
record Souvenir(String name, LocalDate date) {
}
}