
net.sf.aguacate.context.spi.sql.impl.SentenceSqlSelectSingleRow Maven / Gradle / Ivy
package net.sf.aguacate.context.spi.sql.impl;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import net.sf.aguacate.context.spi.sql.SentenceExecutionResult;
import net.sf.aguacate.context.spi.sql.SentenceSqlType;
import net.sf.aguacate.util.config.database.DatabaseInterface;
public class SentenceSqlSelectSingleRow extends AbstractSentenceSql {
private final String table;
private final String[] required;
private final String[] optional;
private final String outputName;
public SentenceSqlSelectSingleRow(String name, String message, String table, List methods,
List required, List optional, String outputName) {
super(name, message, methods);
this.table = table;
this.required = required.toArray(new String[required.size()]);
this.optional = optional.toArray(new String[optional.size()]);
this.outputName = outputName;
}
@Override
public SentenceSqlType getType() {
return SentenceSqlType.SELECT;
}
@Override
public SentenceExecutionResult execute(DatabaseInterface databaseInterface, Connection connection,
Map context) throws SQLException {
return new SentenceExecutionResult(true, databaseInterface.executeSelectSingleRow(getName(), getMessage(),
connection, table, context, required, optional));
}
@Override
public String outputName() {
return outputName;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy