Search in sources :

Example 1 with ProjectVariableReplacer

use of eu.esdihumboldt.hale.common.core.io.project.ProjectVariableReplacer in project hale by halestudio.

the class JDBCUtil method replaceVariables.

/**
 * Replace variables in an SQL query.
 *
 * @param query the query
 * @param services the service provider
 * @return the query with variables replaced
 */
public static String replaceVariables(String query, ServiceProvider services) {
    if (services != null) {
        ProjectInfoService projectInfo = services.getService(ProjectInfoService.class);
        ProjectVariableReplacer replacer = new ProjectVariableReplacer(projectInfo);
        return replacer.replaceVariables(query, true);
    }
    return query;
}
Also used : ProjectInfoService(eu.esdihumboldt.hale.common.core.io.project.ProjectInfoService) ProjectVariableReplacer(eu.esdihumboldt.hale.common.core.io.project.ProjectVariableReplacer)

Aggregations

ProjectInfoService (eu.esdihumboldt.hale.common.core.io.project.ProjectInfoService)1 ProjectVariableReplacer (eu.esdihumboldt.hale.common.core.io.project.ProjectVariableReplacer)1