You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "vidakovic (via GitHub)" <gi...@apache.org> on 2023/08/01 19:56:09 UTC

[GitHub] [fineract] vidakovic commented on a diff in pull request #3321: Fineract-1910 data table query advanced marta

vidakovic commented on code in PR #3321:
URL: https://github.com/apache/fineract/pull/3321#discussion_r1281091257


##########
fineract-core/src/main/java/org/apache/fineract/infrastructure/core/service/database/DatabaseSpecificSQLGenerator.java:
##########
@@ -36,14 +42,26 @@ public DatabaseSpecificSQLGenerator(DatabaseTypeResolver databaseTypeResolver) {
     }
 
     public String escape(String arg) {
-        if (databaseTypeResolver.isMySQL()) {
+        return escape(databaseTypeResolver.databaseType(), arg);
+    }
+
+    public static String escape(DatabaseType dialect, String arg) {

Review Comment:
   I'd also vote to remove the "static"... we have a lot of "utility" classes that have static methods and are just creating problems down the road (example: just have a look at how a tenant's timezone is resolved). Globally there is also no added value in terms of saving mem or similar (by not instantiating a full object); effectively "@Component"s are singletons... and in that form they are composable... with static they are not... there are plenty of examples where this leads to bloated static functions (more than 500 lines of code). The fix is very easy, the class is already instantiated as a singleton, so there's added value by using the static keyword.



-- 
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: commits-unsubscribe@fineract.apache.org

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