Let's say I have below records in a table in DB.
Here Emplid and date combination is my PK. With every change I maintain version of records. (in last 3 rows there are total 3 version as change in number).
Now I want to fetch record where emplid = 1111 date = 28-02-2019 with latest version (user don't know how many version are there in db).
How can I do it with lambda expression.
HrcKey matchedKey = hrcKeyList.stream()
.filter(x -> (currEmplid.equals(x.getEmplid()) &&
format.format(updateListFromUI.getDate())
.equals(format.format(x.getDate()))))
.findFirst()
.orElse(null);
this will give me vesrion 1. but how can I get latest version.