Package com.avoka.core.cayenne
Class QueryTranslatorUtils
- java.lang.Object
-
- com.avoka.core.cayenne.QueryTranslatorUtils
-
public class QueryTranslatorUtils extends Object
Provides utility methods for Cayenne SelectQuery translators.- Since:
- 19.5.0
-
-
Constructor Summary
Constructors Constructor Description QueryTranslatorUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
addCountTranslation(String sql, String pkColumnName)
Translate a plain SELECT query string into a SELECT COUNT DISTINCT query returning a number (the count).
-
-
-
Method Detail
-
addCountTranslation
public static String addCountTranslation(String sql, String pkColumnName)
Translate a plain SELECT query string into a SELECT COUNT DISTINCT query returning a number (the count).- Parameters:
sql
- the query string (required, must not already be a SELECT COUNT query)pkColumnName
- the name of the Cayenne primary column that will be used for counting results (required; can be obtained viaCayenneUtils.getPkName(ObjEntity)
- Returns:
- the modified SQL string
-
-