KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cayenne > query > SQLActionVisitor


1 /*****************************************************************
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  ****************************************************************/

19
20 package org.apache.cayenne.query;
21
22 /**
23  * A factory interface to create standard SQLActions for a set of standard queries.
24  * Instances of SQLActionVisitor are passed by Cayenne to a Query in
25  * {@link org.apache.cayenne.query.Query#createSQLAction(SQLActionVisitor)}, allowing
26  * query to choose the action type and convert itself to a "standard" query if needed.
27  * Individual DbAdapters would provide special visitors, thus allowing for DB-dependent
28  * execution algorithms.
29  *
30  * @see org.apache.cayenne.query.Query#createSQLAction(SQLActionVisitor)
31  * @since 1.2
32  * @author Andrus Adamchik
33  */

34 public interface SQLActionVisitor {
35
36     /**
37      * Creates an action to execute a generic update query.
38      */

39     SQLAction updateAction(Query query);
40
41     /**
42      * Creates an action to execute a batch update query.
43      */

44     SQLAction batchAction(BatchQuery query);
45
46     /**
47      * Creates an action to execute a SelectQuery.
48      */

49     SQLAction objectSelectAction(SelectQuery query);
50
51     /**
52      * Creates an action to execute a SQLTemplate.
53      */

54     SQLAction sqlAction(SQLTemplate query);
55
56     /**
57      * Creates an action to execute a ProcedureQuery.
58      */

59     SQLAction procedureAction(ProcedureQuery query);
60
61     /**
62      * Creates an action to execute EJBQL query.
63      */

64     SQLAction ejbqlAction(EJBQLQuery query);
65 }
66
Popular Tags