KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jdo > spi > persistence > support > sqlstore > SCOCollection


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 in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
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 Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * SCOCollection.java
26  *
27  * created April 3, 2000
28  *
29  * @author Marina Vatkina
30  * @version 1.0
31  */

32
33 package com.sun.jdo.spi.persistence.support.sqlstore;
34 import java.util.Collection JavaDoc;
35
36 public interface SCOCollection extends java.util.Collection JavaDoc, SCO
37 {
38     /**
39      * Resets removed and added lists after flush
40      */

41     void reset();
42
43     /*
44      * Mark the collection as deferred so any updates won't
45      * be applied until markDeferred() gets called
46      */

47     void markDeferred();
48
49     /*
50      * Return true is this collection has been marked as deferred.
51      * False otherwise.
52      */

53     boolean isDeferred();
54
55     /*
56      * Apply deferred updates if there is any. The given
57      * collection c will be added to the underlying collection
58      * before the deferred updates are applied.
59      */

60     void applyDeferredUpdates(Collection JavaDoc c);
61
62     /**
63      * Adds object to the Collection without recording
64      * the event. Used internaly to initially populate the Collection
65      */

66     void addInternal(Object JavaDoc o);
67
68     /**
69      * Adds objects of the given Collection to this Collection without recording
70      * the event. Used internaly to initially populate the Collection
71      */

72     void addAllInternal(Collection JavaDoc c);
73
74     /**
75      * Adds an object to the list without recording changes.
76      */

77     void addToBaseCollection(Object JavaDoc o);
78
79     /**
80      * Removes objects of the given Collection from this Collection without recording
81      * the event. Used internaly to remove a collection of elements from this collection.
82      */

83     void removeAllInternal(Collection JavaDoc c);
84
85     /**
86      * Clears Collection without recording
87      * the event. Used internaly to clear the Collection
88      */

89     void clearInternal();
90
91
92     /**
93      * Removes element from the Collection without recording
94      * the event. Used internaly to update the Collection
95      */

96     void removeInternal(Object JavaDoc o);
97
98     /**
99      * Returns the Collection of added elements
100      *
101      * @return Collection of the added elements as java.util.Collection
102      */

103     Collection JavaDoc getAdded();
104
105     /**
106      * Returns the Collection of removed elements
107      *
108      * @return Collection of the removed elements as java.util.Collection
109      */

110     Collection JavaDoc getRemoved();
111
112     /**
113      * Sets a new owner for the SCO instance that is not owned
114      * by any other object.
115      *
116      * @param owner the new owner
117      * @param fieldName as java.lang.String
118      * @param elementType the new element type as Class, or null if type
119      * is not to be checke.
120      * @throws com.sun.jdo.api.persistence.support.JDOUserException if the
121      * instance is owned by another owner.
122      */

123     void setOwner(Object JavaDoc owner, String JavaDoc fieldName, Class JavaDoc elementType);
124
125 }
126
Popular Tags