01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
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: package org.apache.openjpa.kernel;
20:
21: import java.util.Collection;
22: import java.util.Iterator;
23: import java.util.List;
24:
25: /**
26: * Representation of all members of a persistent class.
27: *
28: * @author Abe White
29: * @author Patrick Linskey
30: */
31: public interface Extent {
32:
33: /**
34: * Return the (mutable) fetch configuration for this extent.
35: */
36: public FetchConfiguration getFetchConfiguration();
37:
38: /**
39: * Whether this extent will ignore changes made in the current transaction.
40: */
41: public boolean getIgnoreChanges();
42:
43: /**
44: * Whether this extent will ignore changes made in the current transaction.
45: */
46: public void setIgnoreChanges(boolean ignoreChanges);
47:
48: /**
49: * Returns a list of all objects represented by this extent. This method
50: * creates a {@link List} by traversing the entire iterator returned by a
51: * call to {@link #iterator}. This means that {@link Collection#size} will
52: * work correctly, but if the extent represents a large data set, this
53: * method may be quite slow and may consume quite a bit of memory.
54: */
55: public List list();
56:
57: /**
58: * Return an iterator over the extent members.
59: */
60: public Iterator iterator();
61:
62: /**
63: * The broker that generated the extent.
64: */
65: public Broker getBroker();
66:
67: /**
68: * The class of extent elements.
69: */
70: public Class getElementType();
71:
72: /**
73: * Whether the extent includes subclasses.
74: */
75: public boolean hasSubclasses();
76:
77: /**
78: * Close all open iterators.
79: */
80: public void closeAll();
81:
82: /**
83: * Synchronizes on an internal lock.
84: */
85: public void lock();
86:
87: /**
88: * Release the internal lock.
89: */
90: public void unlock();
91: }
|