com.jpattern.orm.query.OrmCustomFindQuery Maven / Gradle / Ivy
package com.jpattern.orm.query;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import com.jpattern.orm.classtool.IOrmClassToolMap;
import com.jpattern.orm.exception.OrmException;
import com.jpattern.orm.exception.OrmNotUniqueResultException;
import com.jpattern.orm.query.clause.From;
import com.jpattern.orm.query.clause.OrderBy;
import com.jpattern.orm.query.clause.OrmFrom;
import com.jpattern.orm.query.clause.OrmOrderBy;
import com.jpattern.orm.query.clause.OrmSelectClause;
import com.jpattern.orm.query.clause.OrmWhere;
import com.jpattern.orm.query.clause.SelectClause;
import com.jpattern.orm.query.clause.Where;
import com.jpattern.orm.session.ResultSetReader;
import com.jpattern.orm.session.SessionSqlPerformer;
import com.jpattern.orm.session.SqlPerformer;
/**
*
* @author Francesco Cina
*
* 20/giu/2011
*/
public class OrmCustomFindQuery extends AQuery implements CustomFindQuery, INameSolverConsumer {
private INameSolver nameSolver = new NullNameSolver();
private final SelectClause select;
private final IOrmClassToolMap ormClassToolMap;
private final Class> clazz;
// private final Class>[] joinClasses;
private final SessionSqlPerformer session;
private int queryTimeout = 0;
private int maxRows = 0;
private LockMode lockMode = LockMode.NO_LOCK;
private final Where whereExpression = new OrmWhere(this);
private final OrmOrderBy orderBy = new OrmOrderBy(this);
private final From from;
public OrmCustomFindQuery(String selectClause, IOrmClassToolMap ormClassToolMap, SessionSqlPerformer session, Class> clazz) {
this.ormClassToolMap = ormClassToolMap;
this.session = session;
this.clazz = clazz;
from = new OrmFrom(ormClassToolMap,this);
select = new OrmSelectClause(selectClause, this);
}
@Override
public void setNameSolver(INameSolver nameSolver) {
this.nameSolver = nameSolver;
where().setNameSolver(nameSolver);
orderBy().setNameSolver(nameSolver);
from().setNameSolver(nameSolver);
select.setNameSolver(nameSolver);
}
@Override
public List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy