com.googlecode.jpattern.orm.query.sql.SqlQuery Maven / Gradle / Ivy
package com.googlecode.jpattern.orm.query.sql;
import java.math.BigDecimal;
import java.util.List;
import com.googlecode.jpattern.orm.exception.OrmException;
import com.googlecode.jpattern.orm.exception.OrmNotUniqueResultException;
import com.googlecode.jpattern.orm.query.AQuery;
import com.googlecode.jpattern.orm.query.ISqlQuery;
import com.googlecode.jpattern.orm.session.IResultSetReader;
import com.googlecode.jpattern.orm.session.ISessionSqlPerformer;
import com.googlecode.jpattern.orm.session.ISqlPerformer;
/**
*
* @author Francesco Cina
*
* 09/lug/2011
*/
public class SqlQuery extends AQuery implements ISqlQuery {
private final ISessionSqlPerformer session;
private final String sql;
private final Object[] args;
public SqlQuery(ISessionSqlPerformer session, String sql, Object[] args) {
this.session = session;
this.sql = sql;
this.args = args;
}
@Override
public T find(IResultSetReader rse) throws OrmException {
ISqlPerformer sqlExec = session.sqlPerformer();
sqlExec.setMaxRows(getMaxRows());
sqlExec.setQueryTimeout(getQueryTimeout());
return sqlExec.query(renderSql(), rse , args);
}
@Override
public List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy