org.onetwo.dbm.query.DbmQueryWrapperImpl Maven / Gradle / Ivy
The newest version!
package org.onetwo.dbm.query;
import java.util.List;
import java.util.Map;
import org.onetwo.common.db.AbstractQueryWrapper;
import org.onetwo.common.db.spi.QueryWrapper;
import org.onetwo.common.utils.LangUtils;
import org.onetwo.dbm.dialet.DBDialect.LockInfo;
import org.springframework.jdbc.core.RowMapper;
public class DbmQueryWrapperImpl extends AbstractQueryWrapper {
private DbmQuery dbmQuery;
/***
* 是否自动生成分页sql片段
*/
// private boolean useAutoLimitSqlIfPagination = true;
public DbmQueryWrapperImpl(DbmQuery jfishQuery) {
super();
this.dbmQuery = jfishQuery;
}
public boolean isUseAutoLimitSqlIfPagination() {
return dbmQuery.isUseAutoLimitSqlIfPagination();
}
public void setUseAutoLimitSqlIfPagination(boolean useAutoLimitSqlIfPagination) {
this.dbmQuery.setUseAutoLimitSqlIfPagination(useAutoLimitSqlIfPagination);
}
public QueryWrapper setLockInfo(LockInfo lockInfo){
this.dbmQuery.setLockInfo(lockInfo);
return this;
}
@Override
public int executeUpdate() {
return dbmQuery.executeUpdate();
}
@Override
public List getResultList() {
// DbmQueryImpl#getResultList
return dbmQuery.getResultList();
}
/***
* 查找唯一结果,如果找不到则返回null,找到多个则抛异常 IncorrectResultSizeDataAccessException,详见:DataAccessUtils.requiredSingleResult
*/
@Override
public T getSingleResult() {
return dbmQuery.getSingleResult();
}
@Override
public QueryWrapper setFirstResult(int startPosition) {
dbmQuery.setFirstResult(startPosition);
return this;
}
@Override
public QueryWrapper setMaxResults(int maxResult) {
dbmQuery.setMaxResults(maxResult);
return this;
}
@Override
public QueryWrapper setParameter(int position, Object value) {
dbmQuery.setParameter(position, value);
return this;
}
@Override
public QueryWrapper setParameter(String name, Object value) {
dbmQuery.setParameter(name, value);
return this;
}
@Override
public QueryWrapper setParameters(Map params) {
dbmQuery.setParameters(params);
return this;
}
@Override
public QueryWrapper setParameters(List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy