001/**
002 * Copyright 2015 Tampere University of Technology, Pori Department
003 * 
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 * 
008 *   http://www.apache.org/licenses/LICENSE-2.0
009 * 
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package core.tut.pori.dao.clause;
017
018import java.util.Collection;
019
020/**
021 * A simple SQL WHERE OR clause.
022 * 
023 * This class will always prefix the clause with OR, and giving multiple values equals to SQL OR IN (?,?,...)
024 * 
025 * Passing null object, null array or empty array equals to providing the clause with SQL NULL. An array can also have a null value.
026 */
027public class OrClause extends AndClause{
028  /**
029   * 
030   * @param column
031   * @param value
032   * @param type
033   */
034  public OrClause(String column, Object value, SQLType type){
035    super(column, value, type);
036  }
037  
038  /**
039   * 
040   * @param column
041   * @param values
042   * @param type
043   */
044  public OrClause(String column, Object[] values, SQLType type){
045    super(column, values, type);
046  }
047  
048  /**
049   * @param column
050   * @param values
051   * @param type
052   */
053  public OrClause(String column, Collection<? extends Object> values, SQLType type) {
054    super(column, values, type);
055  }
056
057  /**
058   * 
059   * @param column
060   * @param values
061   */
062  public OrClause(String column, int[] values){
063    super(column,values);
064  }
065  
066  /**
067   * 
068   * @param column
069   * @param values
070   */
071  public OrClause(String column, long[] values){
072    super(column,values);
073  }
074  
075  /**
076   * 
077   * @param column
078   * @param values
079   */
080  public OrClause(String column, double[] values){
081    super(column,values);
082  }
083  
084  /**
085   * 
086   * @param column
087   * @param values
088   */
089  public OrClause(String column, boolean[] values){
090    super(column,values);
091  }
092
093  @Override
094  public ClauseType getClauseType() {
095    return ClauseType.OR;
096  }
097}