use of org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_TENANT_RESOURCES_SELECT_COLUMNS_MYSQL in project carbon-identity-framework by wso2.
the class ConfigurationDAOImpl method buildPlaceholderSQL.
private PlaceholderSQL buildPlaceholderSQL(Condition condition, boolean useCreatedTime) throws ConfigurationManagementException {
String queryWithCreatedTime = GET_TENANT_RESOURCES_SELECT_COLUMNS_MYSQL;
String queryWithOutCreatedTime = GET_TENANT_RESOURCES_SELECT_COLUMNS_MYSQL_WITHOUT_CREATED_TIME;
try {
if (isOracleDB() || isMSSqlDB()) {
queryWithCreatedTime = GET_TENANT_RESOURCES_SELECT_COLUMNS_MSSQL_OR_ORACLE;
}
} catch (DataAccessException e) {
throw handleServerException(ERROR_CODE_CHECK_DB_METADATA, e.getMessage(), e);
}
StringBuilder sb = new StringBuilder();
sb.append(useCreatedTime ? queryWithCreatedTime : queryWithOutCreatedTime);
sb.append("WHERE\n");
try {
PlaceholderSQL placeholderSQL = condition.buildQuery(new PrimitiveConditionValidator(new ResourceSearchBean()));
placeholderSQL.setQuery(sb.append(placeholderSQL.getQuery()).toString());
return placeholderSQL;
} catch (PrimitiveConditionValidationException e) {
throw handleClientException(ERROR_CODE_SEARCH_QUERY_SQL_PROPERTY_PARSE_ERROR, e.getMessage(), e);
}
}
Aggregations