Package org.apache.gora.sql.statement

Examples of org.apache.gora.sql.statement.Delete


    return false;
  }

  @Override
  public boolean delete(K key) throws IOException {
    Delete delete = new Delete();
    delete.from(sqlTable.getName())
          .where().equals(primaryColumn.getName(), "?");

    PreparedStatement statement = null;
    try {
      statement = connection.prepareStatement(delete.toString());
      setObject(statement, 1, key, keySqlType, primaryColumn);

      int ret = statement.executeUpdate();
      return ret > 0;
    } catch (SQLException ex) {
View Full Code Here


    }
  }

  @Override
  public long deleteByQuery(Query<K, T> query) throws IOException {
    Delete delete = new Delete().from(sqlTable.getName());
    delete.where(constructWhereClause(query));

    PreparedStatement statement = null;
    try {
      statement = connection.prepareStatement(delete.toString());
      setParametersForPreparedStatement(statement, query);

      return statement.executeUpdate();

    } catch (SQLException ex) {
View Full Code Here

TOP

Related Classes of org.apache.gora.sql.statement.Delete

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.