Package org.apache.openjpa.kernel
Class DelegatingExtent<T>
- java.lang.Object
-
- org.apache.openjpa.kernel.DelegatingExtent<T>
-
-
Constructor Summary
Constructors Constructor Description DelegatingExtent(Extent<T> extent)
Constructor; supply delegate.DelegatingExtent(Extent<T> extent, RuntimeExceptionTranslator trans)
Constructor; supply delegate and exception translator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeAll()
Close all open iterators.boolean
equals(java.lang.Object other)
Broker
getBroker()
The broker that generated the extent.Extent<T>
getDelegate()
Return the direct delegate.java.lang.Class<T>
getElementType()
The class of extent elements.FetchConfiguration
getFetchConfiguration()
Return the (mutable) fetch configuration for this extent.boolean
getIgnoreChanges()
Whether this extent will ignore changes made in the current transaction.Extent<T>
getInnermostDelegate()
Return the native delegate.int
hashCode()
boolean
hasSubclasses()
Whether the extent includes subclasses.java.util.Iterator<T>
iterator()
Return an iterator over the extent members.java.util.List<T>
list()
Returns a list of all objects represented by this extent.void
lock()
Synchronizes on an internal lock.void
setIgnoreChanges(boolean ignoreCache)
Whether this extent will ignore changes made in the current transaction.protected java.lang.RuntimeException
translate(java.lang.RuntimeException re)
Translate the OpenJPA exception.void
unlock()
Release the internal lock.
-
-
-
Constructor Detail
-
DelegatingExtent
public DelegatingExtent(Extent<T> extent, RuntimeExceptionTranslator trans)
Constructor; supply delegate and exception translator.
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
translate
protected java.lang.RuntimeException translate(java.lang.RuntimeException re)
Translate the OpenJPA exception.
-
getElementType
public java.lang.Class<T> getElementType()
Description copied from interface:Extent
The class of extent elements.- Specified by:
getElementType
in interfaceExtent<T>
-
hasSubclasses
public boolean hasSubclasses()
Description copied from interface:Extent
Whether the extent includes subclasses.- Specified by:
hasSubclasses
in interfaceExtent<T>
-
getBroker
public Broker getBroker()
Description copied from interface:Extent
The broker that generated the extent.
-
getFetchConfiguration
public FetchConfiguration getFetchConfiguration()
Description copied from interface:Extent
Return the (mutable) fetch configuration for this extent.- Specified by:
getFetchConfiguration
in interfaceExtent<T>
-
getIgnoreChanges
public boolean getIgnoreChanges()
Description copied from interface:Extent
Whether this extent will ignore changes made in the current transaction.- Specified by:
getIgnoreChanges
in interfaceExtent<T>
-
setIgnoreChanges
public void setIgnoreChanges(boolean ignoreCache)
Description copied from interface:Extent
Whether this extent will ignore changes made in the current transaction.- Specified by:
setIgnoreChanges
in interfaceExtent<T>
-
list
public java.util.List<T> list()
Description copied from interface:Extent
Returns a list of all objects represented by this extent. This method creates aList
by traversing the entire iterator returned by a call toExtent.iterator()
. This means thatCollection.size()
will work correctly, but if the extent represents a large data set, this method may be quite slow and may consume quite a bit of memory.
-
iterator
public java.util.Iterator<T> iterator()
Description copied from interface:Extent
Return an iterator over the extent members.
-
closeAll
public void closeAll()
Description copied from interface:Extent
Close all open iterators.
-
lock
public void lock()
Description copied from interface:Extent
Synchronizes on an internal lock.
-
-