Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*******************************************************************************
* Copyright 2013 Francesco Cina'
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
package com.jporm.sql.dsl.query.where;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.jporm.sql.dsl.dialect.DBProfile;
import com.jporm.sql.dsl.query.ASqlSubElement;
import com.jporm.sql.dsl.query.Sql;
import com.jporm.sql.dsl.query.select.SelectCommon;
import com.jporm.sql.dsl.query.where.expression.Exp;
/**
*
* @author Francesco Cina
*
* 19/giu/2011
*/
public abstract class WhereImpl> extends ASqlSubElement implements Where {
private List elementList = new ArrayList();
private final Sql parentSql;
public WhereImpl(Sql parentSql) {
this.parentSql = parentSql;
}
private WHERE addExpression(final WhereExpressionElement expressionElement) {
getElementList().add(expressionElement);
return getWhere();
}
@Override
public final WHERE allEq(final Map propertyMap) {
for (final Entry entry : propertyMap.entrySet()) {
eq(entry.getKey(), entry.getValue());
}
return getWhere();
}
@Override
public final WHERE and(final List expressionElements) {
return addExpression(Exp.and(expressionElements));
}
@Override
public final WHERE and(final String customClause, final Object... args) {
return addExpression(Exp.and(customClause, args));
}
@Override
public final WHERE and(final WhereExpressionElement... expressionElements) {
if (expressionElements.length > 0) {
and(Arrays.asList(expressionElements));
}
return getWhere();
}
@Override
public final void sqlElementValues(final List