All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.cayenne.query.SQLActionVisitor Maven / Gradle / Ivy

There is a newer version: 2.0.4
Show newest version
/*****************************************************************
 *   Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you 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 org.apache.cayenne.query;

/**
 * A factory interface to create standard SQLActions for a set of standard queries.
 * Instances of SQLActionVisitor are passed by Cayenne to a Query in
 * {@link org.apache.cayenne.query.Query#createSQLAction(SQLActionVisitor)},
 * allowing query to choose the action type and convert itself to a "standard" query if
 * needed. Individual DbAdapters would provide special visitors, thus allowing for
 * DB-dependent execution algorithms.
 * 
 * @see org.apache.cayenne.query.Query#createSQLAction(SQLActionVisitor)
 * @since 1.2
 * @author Andrus Adamchik
 */
public interface SQLActionVisitor {

    /**
     * Executes a generic update query.
     */
    SQLAction updateAction(Query query);

    /**
     * Executes a batch update query.
     */
    SQLAction batchAction(BatchQuery query);

    /**
     * Executes a SelectQuery.
     */
    SQLAction objectSelectAction(SelectQuery query);

    /**
     * Executes a SQLTemplate.
     */
    SQLAction sqlAction(SQLTemplate query);

    /**
     * Executes a ProcedureQuery.
     */
    SQLAction procedureAction(ProcedureQuery query);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy