KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > queryframework > ModifyQuery


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2005, Oracle. All rights reserved.
22
package oracle.toplink.essentials.queryframework;
23
24 import oracle.toplink.essentials.internal.sessions.AbstractRecord;
25
26 /**
27  * <p><b>Purpose</b>:
28  * Abstract class for all modify queries.
29  * Currently contains no behavoir.
30  *
31  * @author Yvon Lavoie
32  * @since TOPLink/Java 1.0
33  */

34 public abstract class ModifyQuery extends DatabaseQuery {
35     protected AbstractRecord modifyRow;
36     
37     // needed to allow the user to force SQL to database when batch writing is used. bug:4104613
38
protected boolean forceBatchStatementExecution = false;
39
40     /**
41      * INTERNAL:
42      * Return the modify row
43      */

44     public AbstractRecord getModifyRow() {
45         return modifyRow;
46     }
47
48     /**
49      * PUBLIC:
50      * Return if this is a modify query.
51      */

52     public boolean isModifyQuery() {
53         return true;
54     }
55
56     /**
57      * INTERNAL:
58      * Set the modify row
59      */

60     public void setModifyRow(AbstractRecord row) {
61         modifyRow = row;
62     }
63     
64     /**
65      * PUBLIC:
66      * Allow setting this query to be the last statement added to a batch statement
67      * and ensure it is flushed on execution. Setting to true will cause the batch
68      * statement to be sent to the database. Default setting of false causes the batch
69      * statement execution to be delayed to allow additional statements to
70      * be added. Setting to true reduces the efficiency of batch writting.
71      *
72      * This has no effect if batch writing is not enabled.
73      */

74      
75     public void setForceBatchStatementExecution(boolean value) {
76         this.forceBatchStatementExecution = value;
77     }
78     
79     /**
80      * PUBLIC:
81      * Returns if this query has been set to flush on execution.
82      * @see #setForceBatchStatementExecution(boolean)
83      */

84      
85     public boolean forceBatchStatementExecution() {
86         return forceBatchStatementExecution;
87     }
88 }
89
Popular Tags