Package se.unlogic.standardutils.dao.querys

Examples of se.unlogic.standardutils.dao.querys.BooleanQuery


   
  }

  public BooleanQuery getBooleanQuery(String sql) throws SQLException {

    BooleanQuery query = new BooleanQuery(connection, false, sql);
   
    checkQueryList();
   
    this.queryList.add(query);
   
View Full Code Here


    return beanExists(bean, transactionHandler.getConnection());
  }

  public boolean beanExists(T bean, Connection connection) throws SQLException {

    BooleanQuery query = null;

    try {

      query = new BooleanQuery(connection, false, this.checkIfExistsSQL);

      IntegerCounter integerCounter = new IntegerCounter();

      // Keys from SimpleColumns for where statement
      this.setQueryValues(bean, query, integerCounter, this.simpleKeys);

      // Keys from many to one relations for where statement
      this.setQueryValues(bean, query, integerCounter, this.manyToOneRelationKeys.values());

      return query.executeQuery();

    } finally {

      BooleanQuery.autoCloseQuery(query);
    }
View Full Code Here

    return this.getBoolean(lowLevelQuery, transactionHandler.getConnection());
  }

  public boolean getBoolean(LowLevelQuery<T> lowLevelQuery, Connection connection) throws SQLException {

    BooleanQuery query = null;

    try {

      query = new BooleanQuery(connection, false, lowLevelQuery.getSql());

      this.setCustomQueryParameters(query, lowLevelQuery.getParameters());

      return query.executeQuery();

    } finally {

      PreparedStatementQuery.autoCloseQuery(query);
    }
View Full Code Here

    return this.getBoolean(highLevelQuery, transactionHandler.getConnection());
  }

  public boolean getBoolean(HighLevelQuery<T> highLevelQuery, Connection connection) throws SQLException {

    BooleanQuery query = null;

    try {
      query = new BooleanQuery(connection, false, this.getSQL + this.getCriterias(highLevelQuery, true));

      if (highLevelQuery.getParameters() != null) {

        setQueryParameters(query, highLevelQuery, 1);
      }

      return query.executeQuery();

    } finally {

      PreparedStatementQuery.autoCloseQuery(query);
    }
View Full Code Here

    return beanExists(bean, transactionHandler.getConnection());
  }

  public boolean beanExists(T bean, Connection connection) throws SQLException {

    BooleanQuery query = null;

    try {

      query = new BooleanQuery(connection, false, this.checkIfExistsSQL);

      IntegerCounter integerCounter = new IntegerCounter();

      // Keys from SimpleColumns for where statement
      this.setQueryValues(bean, query, integerCounter, this.simpleKeys);

      // Keys from many to one relations for where statement
      this.setQueryValues(bean, query, integerCounter, this.manyToOneRelationKeys.values());

      return query.executeQuery();

    } finally {

      BooleanQuery.autoCloseQuery(query);
    }
View Full Code Here

    return this.getBoolean(lowLevelQuery, transactionHandler.getConnection());
  }

  public boolean getBoolean(LowLevelQuery<T> lowLevelQuery, Connection connection) throws SQLException {

    BooleanQuery query = null;

    try {

      query = new BooleanQuery(connection, false, lowLevelQuery.getSql());

      this.setCustomQueryParameters(query, lowLevelQuery.getParameters());

      return query.executeQuery();

    } finally {

      PreparedStatementQuery.autoCloseQuery(query);
    }
View Full Code Here

    return this.getBoolean(highLevelQuery, transactionHandler.getConnection());
  }

  public boolean getBoolean(HighLevelQuery<T> highLevelQuery, Connection connection) throws SQLException {

    BooleanQuery query = null;

    try {
      query = new BooleanQuery(connection, false, this.getSQL + this.getCriterias(highLevelQuery, true));

      if (highLevelQuery.getParameters() != null) {

        setQueryParameters(query, highLevelQuery, 1);
      }

      return query.executeQuery();

    } finally {

      PreparedStatementQuery.autoCloseQuery(query);
    }
View Full Code Here

   
  }

  public BooleanQuery getBooleanQuery(String sql) throws SQLException {

    BooleanQuery query = new BooleanQuery(connection, false, sql);
   
    checkQueryList();
   
    this.queryList.add(query);
   
View Full Code Here

TOP

Related Classes of se.unlogic.standardutils.dao.querys.BooleanQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.