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


##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java:
##########
@@ -329,25 +307,13 @@ public PolarisBaseEntity lookupEntityByName(
       long parentId,
       int typeCode,
       @Nonnull String name) {
-    Map<String, Object> params =
-        Map.of(
-            "catalog_id",
-            catalogId,
-            "parent_id",
-            parentId,
-            "type_code",
-            typeCode,
-            "name",
-            name,
-            "realm_id",
-            realmId);
+    List<Object> params = List.of(catalogId, parentId, typeCode, name, 
realmId);
     return getPolarisBaseEntity(
-        QueryGenerator.generateSelectQuery(
-            ModelEntity.ALL_COLUMNS, ModelEntity.TABLE_NAME, params));
+        new PreparedQuery(SQLConstants.ENTITY_LOOKUP_BY_NAME_QUERY, params));

Review Comment:
   Any class name would work for me. My point is that co-locating the SQL text 
(with placeholders) and the code that binds values to those placeholders makes 
maintenance easier.



-- 
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: issues-unsubscr...@polaris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to