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.persistence;
20:
21: import java.util.List;
22:
23: /**
24: * An extent is a logical view of all instances of a class.
25: *
26: * @author Abe White
27: * @since 0.4.0
28: * @published
29: */
30: public interface Extent<T> extends Iterable<T> {
31:
32: /**
33: * The extent's element type.
34: */
35: public Class<T> getElementClass();
36:
37: /**
38: * Whether the extent includes subclasses.
39: */
40: public boolean hasSubclasses();
41:
42: /**
43: * The owning entity manager.
44: */
45: public OpenJPAEntityManager getEntityManager();
46:
47: /**
48: * Fetch configuration for controlling how iterated objects are loaded.
49: */
50: public FetchPlan getFetchPlan();
51:
52: /**
53: * Whether the extent sees inserts and deletes in the current transaction.
54: */
55: public boolean getIgnoreChanges();
56:
57: /**
58: * Whether the extent sees inserts and deletes in the current transaction.
59: */
60: public void setIgnoreChanges(boolean ignoreChanges);
61:
62: /**
63: * List the extent contents.
64: */
65: public List<T> list();
66:
67: /**
68: * Close all open iterators that are consuming database resources.
69: */
70: public void closeAll();
71:
72: /**
73: * @deprecated cast to {@link ExtentImpl} instead. This
74: * method pierces the published-API boundary, as does the SPI cast.
75: */
76: public org.apache.openjpa.kernel.Extent getDelegate();
77: }
|