Package com.avoka.core.cayenne
Class QueryTranslatorUtils
java.lang.Object
com.avoka.core.cayenne.QueryTranslatorUtils
Provides utility methods for Cayenne SelectQuery translators.
- Since:
- 19.5.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
addCountTranslation
(String sql, String pkColumnName) Translate a plain SELECT query string into a SELECT COUNT DISTINCT query returning a number (the count).
-
Constructor Details
-
QueryTranslatorUtils
public QueryTranslatorUtils()
-
-
Method Details
-
addCountTranslation
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
-