net.sf.aguacate.context.spi.sql.impl.SentenceSqlStaticSelectSingle Maven / Gradle / Ivy
package net.sf.aguacate.context.spi.sql.impl;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import net.sf.aguacate.function.FunctionContext;
import net.sf.aguacate.function.FunctionEvalResult;
public class SentenceSqlStaticSelectSingle extends AbstractSentenceSql {
private final String sql;
private final String[] required;
private final String[] optional;
private final String outputName;
public SentenceSqlStaticSelectSingle(String name, String message, String sql, List methods,
List required, List optional, String outputName) {
super(name, message, methods);
this.sql = sql;
this.required = required.toArray(new String[required.size()]);
this.optional = optional.toArray(new String[optional.size()]);
this.outputName = outputName;
}
@Override
public FunctionEvalResult evaluate0(FunctionContext functionContext, Map context)
throws SQLException {
return new FunctionEvalResult(true, functionContext.databaseInterface().executeSqlSelectValue(getName(),
getMessage(), functionContext.acquireConnection(), sql, context, required, optional));
}
@Override
public String getOutputName() {
return outputName;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy