File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
core/src/main/java/google/registry/model/tmch Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 1515package google .registry .model .tmch ;
1616
1717import static google .registry .config .RegistryConfig .getClaimsListCacheDuration ;
18- import static google .registry .persistence .transaction .QueryComposer .Comparator .EQ ;
1918import static google .registry .persistence .transaction .TransactionManagerFactory .tm ;
2019import static google .registry .util .DateTimeUtils .START_OF_TIME ;
2120
@@ -79,14 +78,11 @@ public static ClaimsList get() {
7978 */
8079 private static ClaimsList getUncached () {
8180 return tm ().reTransact (
82- () -> {
83- Long revisionId =
84- tm ().query ("SELECT MAX(revisionId) FROM ClaimsList" , Long .class )
85- .getSingleResult ();
86- return tm ().createQueryComposer (ClaimsList .class )
87- .where ("revisionId" , EQ , revisionId )
88- .first ();
89- })
81+ () ->
82+ tm ().query ("FROM ClaimsList ORDER BY revisionId DESC" , ClaimsList .class )
83+ .setMaxResults (1 )
84+ .getResultStream ()
85+ .findFirst ())
9086 .orElse (ClaimsList .create (START_OF_TIME , ImmutableMap .of ()));
9187 }
9288
You can’t perform that action at this time.
0 commit comments