// no input
public static transient Logger logger = Logger.getLogger(ValidateCatalogueAction.class);
public void service(SourceBean request, SourceBean response) {
Query query;
IStatement statement;
boolean validationResult = false;
String jpaQueryStr;
String sqlQueryStr;
logger.debug("IN");
try {
super.service(request, response);
Set queries = getEngineInstance().getQueryCatalogue().getAllQueries(false);
logger.debug("Query catalogue contains [" + queries.size() + "] first-class query");
Iterator it = queries.iterator();
while(it.hasNext()) {
query = (Query)it.next();
logger.debug("Validating query [" + query.getName() +"] ...");
statement = getEngineInstance().getDataSource().createStatement( query );
statement.setParameters( getEnv() );
jpaQueryStr = statement.getQueryString();
//sqlQueryStr = statement.getSqlQueryString();
logger.debug("Validating query (HQL/JPQL): [" + jpaQueryStr+ "]");
//logger.debug("Validating query (SQL): [" + sqlQueryStr + "]");
try {
//statement.execute(0, 1, 1, true);
logger.debug("Query [" + query.getName() + "] validated sucesfully");
} catch (Throwable t) {
logger.debug("Query [" + query.getName() + "] is not valid");
throw new SpagoBIEngineServiceException(getActionName(), "Query [" + query.getName() + "] is not valid", t);
}
}
try {
writeBackToClient( new JSONAcknowledge() );