dimas-b commented on code in PR #273:
URL: https://github.com/apache/polaris/pull/273#discussion_r2021985357


##########
extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkStore.java:
##########
@@ -278,21 +281,40 @@ long countActiveChildEntities(
   }
 
   List<ModelEntity> lookupFullEntitiesActive(
-      EntityManager session, long catalogId, long parentId, @Nonnull 
PolarisEntityType entityType) {
+      EntityManager session,
+      long catalogId,
+      long parentId,
+      @Nonnull PolarisEntityType entityType,
+      PageToken pageToken) {
     diagnosticServices.check(session != null, "session_is_null");
+    diagnosticServices.check(
+        (pageToken instanceof EntityIdPageToken || pageToken instanceof 
ReadEverythingPageToken),
+        "unexpected_page_token");
     checkInitialized();
 
     // Currently check against ENTITIES not joining with ENTITIES_ACTIVE
     String hql =
-        "SELECT m from ModelEntity m where m.catalogId=:catalogId and 
m.parentId=:parentId and m.typeCode=:typeCode";
+        "SELECT m from ModelEntity m "
+            + "where m.catalogId=:catalogId and m.parentId=:parentId and 
m.typeCode=:typeCode and m.id > :tokenId";
+
+    if (pageToken instanceof EntityIdPageToken) {

Review Comment:
   I guess what I meant to say is that having logic conditional on the runtime 
type of the `PageToken` looks risky to me... and hard to evolve/maintain.
   
   I'm totally fine with each meta store impl. having its own `PageToken` 
implementation, but I do not think token polymorphism makes sense at this level.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to