org.onetwo.common.db.AbstractQueryWrapper Maven / Gradle / Ivy
package org.onetwo.common.db;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.onetwo.common.db.filequery.JNamedQueryKey;
import org.onetwo.common.db.spi.QueryWrapper;
import org.onetwo.common.log.JFishLoggerFactory;
import org.onetwo.common.utils.Assert;
import org.onetwo.common.utils.Page;
import org.onetwo.dbm.dialet.DBDialect.LockInfo;
import org.slf4j.Logger;
abstract public class AbstractQueryWrapper implements QueryWrapper{
protected final Logger logger = JFishLoggerFactory.getLogger(this.getClass());
public static final int PARAMETER_START_INDEX = 0;
@SuppressWarnings("rawtypes")
public QueryWrapper setPageParameter(final Page page) {
if(!page.isPagination())
return this;
return setLimited(page.getFirst()-1, page.getPageSize());
}
public QueryWrapper setLockInfo(LockInfo lockInfo){
throw new UnsupportedOperationException();
}
public LockInfo getLockInfo() {
return null;
}
@Override
public QueryWrapper setParameters(Map params) {
for(Entry entry : params.entrySet()){
setParameter(entry.getKey(), entry.getValue());
}
return this;
}
public void setQueryAttributes(Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy