Class DelegatingJDBCFetchConfiguration
- java.lang.Object
-
- org.apache.openjpa.kernel.DelegatingFetchConfiguration
-
- org.apache.openjpa.jdbc.kernel.DelegatingJDBCFetchConfiguration
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,EagerFetchModes
,JDBCFetchConfiguration
,LRSSizes
,JoinSyntaxes
,FetchConfiguration
,LockLevels
,LockScopes
,QueryFlushModes
public class DelegatingJDBCFetchConfiguration extends DelegatingFetchConfiguration implements JDBCFetchConfiguration
Delegating fetch configuration that can also perform exception transation for use in facades.- Since:
- 0.4.0
- Author:
- Abe White
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.apache.openjpa.jdbc.kernel.EagerFetchModes
EAGER_JOIN, EAGER_NONE, EAGER_PARALLEL
-
Fields inherited from interface org.apache.openjpa.kernel.FetchConfiguration
DEFAULT, FETCH_LOAD, FETCH_NONE, FETCH_REF
-
Fields inherited from interface org.apache.openjpa.jdbc.sql.JoinSyntaxes
SYNTAX_DATABASE, SYNTAX_SQL92, SYNTAX_TRADITIONAL
-
Fields inherited from interface org.apache.openjpa.kernel.LockLevels
LOCK_NONE, LOCK_READ, LOCK_WRITE
-
Fields inherited from interface org.apache.openjpa.kernel.LockScopes
LOCKSCOPE_EXTENDED, LOCKSCOPE_NORMAL
-
Fields inherited from interface org.apache.openjpa.jdbc.kernel.LRSSizes
SIZE_LAST, SIZE_QUERY, SIZE_UNKNOWN
-
Fields inherited from interface org.apache.openjpa.kernel.QueryFlushModes
FLUSH_FALSE, FLUSH_TRUE, FLUSH_WITH_CONNECTION
-
-
Constructor Summary
Constructors Constructor Description DelegatingJDBCFetchConfiguration(JDBCFetchConfiguration delegate)
Constructor; supply delegate.DelegatingJDBCFetchConfiguration(JDBCFetchConfiguration delegate, RuntimeExceptionTranslator trans)
Constructor; supply delegate and exception translator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JDBCFetchConfiguration
addFetchInnerJoin(java.lang.String field)
Addsfield
to the set of fully-qualified field names to eagerly join when loading objects.JDBCFetchConfiguration
addFetchInnerJoins(java.util.Collection fields)
Addsfields
to the set of fully-qualified field names to eagerly join when loading objects.JDBCFetchConfiguration
addJoin(java.lang.String field)
Addsfield
to the set of fully-qualified field names to eagerly join when loading objects.JDBCFetchConfiguration
addJoins(java.util.Collection fields)
Addsfields
to the set of fully-qualified field names to eagerly join when loading objects.JDBCFetchConfiguration
clearJoins()
Clears the set of field names to join when loading data.int
getEagerFetchMode()
Return the eager fetch mode.int
getFetchDirection()
The fetch direction to use as a constant fromResultSet
.java.util.Set
getFetchInnerJoins()
Returns the names of the inner fetch joins that this component will use when loading objects.boolean
getIgnoreDfgForFkSelect()
Affirms if foreign key for a relation field will be pre-fetched as part of the owning object irrespective of whether the field is included in the default fetch group of this fetch configuration.int
getIsolation()
The isolation level for queries issued to the database.JDBCFetchConfiguration
getJDBCDelegate()
Return the JDBC delegate.java.util.Set
getJoins()
Returns the names of the joins that this component will use when loading objects.int
getJoinSyntax()
The join syntax to use.int
getLRSSize()
The large result set size mode to use.int
getResultSetType()
The result set type to use as a constant fromResultSet
.int
getSubclassFetchMode()
Return the subclass fetch mode.int
getSubclassFetchMode(ClassMapping cls)
Return the effective subclass fetch mode for the given type.boolean
hasFetchInnerJoin(java.lang.String field)
Return true if the given fully-qualified inner fetch join has been added.boolean
hasJoin(java.lang.String field)
Return true if the given fully-qualified join has been added.JDBCFetchConfiguration
removeJoin(java.lang.String field)
Removesfield
to the set of fully-qualified field names to eagerly join when loading objects.JDBCFetchConfiguration
removeJoins(java.util.Collection fields)
Removesfields
from the set of fully-qualified field names to eagerly join when loading objects.JDBCFetchConfiguration
setEagerFetchMode(int mode)
Set the eager fetch mode.JDBCFetchConfiguration
setFetchDirection(int direction)
The fetch direction to use as a constant fromResultSet
.void
setIgnoreDfgForFkSelect(boolean b)
Affirms if foreign key for a relation field will be pre-fetched as part of the owning object irrespective of whether the field is included in the default fetch group of this fetch configuration.JDBCFetchConfiguration
setIsolation(int level)
The isolation level for queries issued to the database.JDBCFetchConfiguration
setJoinSyntax(int syntax)
The join syntax to use.JDBCFetchConfiguration
setLRSSize(int lrsSize)
The large result set size mode to use.JDBCFetchConfiguration
setResultSetType(int type)
The result set type to use as a constant fromResultSet
.JDBCFetchConfiguration
setSubclassFetchMode(int mode)
Set the subclass fetch mode.JDBCFetchConfiguration
traverseJDBC(FieldMetaData fm)
Convenience method to cast traversal to store-specific type.-
Methods inherited from class org.apache.openjpa.kernel.DelegatingFetchConfiguration
addFetchGroup, addFetchGroups, addField, addFields, clearFetchGroups, clearFields, clone, copy, equals, getCacheRetrieveMode, getCacheStoreMode, getContext, getDelegate, getExtendedPathLookup, getFetchBatchSize, getFetchGroups, getFields, getFlushBeforeQueries, getHint, getHints, getInnermostDelegate, getLockScope, getLockTimeout, getMaxFetchDepth, getQueryCacheEnabled, getQueryTimeout, getReadLockLevel, getRootClasses, getRootInstances, getWriteLockLevel, hasFetchGroup, hasField, hashCode, isDefaultPUFetchGroupConfigurationOnly, isFetchConfigurationSQLCacheAdmissible, isHintSet, lock, newResultList, removeFetchGroup, removeFetchGroups, removeField, removeFields, requiresFetch, requiresLoad, resetFetchGroups, setCacheRetrieveMode, setCacheStoreMode, setContext, setExtendedPathLookup, setFetchBatchSize, setFlushBeforeQueries, setHint, setHint, setLockScope, setLockTimeout, setMaxFetchDepth, setQueryCacheEnabled, setQueryTimeout, setReadLockLevel, setRootClasses, setRootInstances, setWriteLockLevel, translate, traverse, unlock
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.openjpa.kernel.FetchConfiguration
addFetchGroup, addFetchGroups, addField, addFields, clearFetchGroups, clearFields, clone, copy, getCacheRetrieveMode, getCacheStoreMode, getContext, getExtendedPathLookup, getFetchBatchSize, getFetchGroups, getFields, getFlushBeforeQueries, getHint, getHints, getLockScope, getLockTimeout, getMaxFetchDepth, getQueryCacheEnabled, getQueryTimeout, getReadLockLevel, getRootClasses, getRootInstances, getWriteLockLevel, hasFetchGroup, hasField, isDefaultPUFetchGroupConfigurationOnly, isFetchConfigurationSQLCacheAdmissible, isHintSet, lock, newResultList, removeFetchGroup, removeFetchGroups, removeField, removeFields, requiresFetch, requiresLoad, resetFetchGroups, setCacheRetrieveMode, setCacheStoreMode, setContext, setExtendedPathLookup, setFetchBatchSize, setFlushBeforeQueries, setHint, setHint, setLockScope, setLockTimeout, setMaxFetchDepth, setQueryCacheEnabled, setQueryTimeout, setReadLockLevel, setRootClasses, setRootInstances, setWriteLockLevel, traverse, unlock
-
-
-
-
Constructor Detail
-
DelegatingJDBCFetchConfiguration
public DelegatingJDBCFetchConfiguration(JDBCFetchConfiguration delegate)
Constructor; supply delegate.
-
DelegatingJDBCFetchConfiguration
public DelegatingJDBCFetchConfiguration(JDBCFetchConfiguration delegate, RuntimeExceptionTranslator trans)
Constructor; supply delegate and exception translator.
-
-
Method Detail
-
getJDBCDelegate
public JDBCFetchConfiguration getJDBCDelegate()
Return the JDBC delegate.
-
getEagerFetchMode
public int getEagerFetchMode()
Description copied from interface:JDBCFetchConfiguration
Return the eager fetch mode. Defaults to theopenjpa.jdbc.EagerFetchMode
setting.- Specified by:
getEagerFetchMode
in interfaceJDBCFetchConfiguration
-
setEagerFetchMode
public JDBCFetchConfiguration setEagerFetchMode(int mode)
Description copied from interface:JDBCFetchConfiguration
Set the eager fetch mode. Defaults to theopenjpa.jdbc.EagerFetchMode
setting.- Specified by:
setEagerFetchMode
in interfaceJDBCFetchConfiguration
-
getSubclassFetchMode
public int getSubclassFetchMode()
Description copied from interface:JDBCFetchConfiguration
Return the subclass fetch mode. Defaults to theopenjpa.jdbc.SubclassFetchMode
setting.- Specified by:
getSubclassFetchMode
in interfaceJDBCFetchConfiguration
-
getSubclassFetchMode
public int getSubclassFetchMode(ClassMapping cls)
Description copied from interface:JDBCFetchConfiguration
Return the effective subclass fetch mode for the given type.- Specified by:
getSubclassFetchMode
in interfaceJDBCFetchConfiguration
-
setSubclassFetchMode
public JDBCFetchConfiguration setSubclassFetchMode(int mode)
Description copied from interface:JDBCFetchConfiguration
Set the subclass fetch mode. Defaults to theopenjpa.jdbc.SubclassFetchMode
setting.- Specified by:
setSubclassFetchMode
in interfaceJDBCFetchConfiguration
-
getResultSetType
public int getResultSetType()
Description copied from interface:JDBCFetchConfiguration
The result set type to use as a constant fromResultSet
. Defaults to theopenjpa.jdbc.ResultSetType
setting.- Specified by:
getResultSetType
in interfaceJDBCFetchConfiguration
-
setResultSetType
public JDBCFetchConfiguration setResultSetType(int type)
Description copied from interface:JDBCFetchConfiguration
The result set type to use as a constant fromResultSet
. Defaults to theopenjpa.jdbc.ResultSetType
setting.- Specified by:
setResultSetType
in interfaceJDBCFetchConfiguration
-
getFetchDirection
public int getFetchDirection()
Description copied from interface:JDBCFetchConfiguration
The fetch direction to use as a constant fromResultSet
. Defaults to theopenjpa.jdbc.FetchDirection
setting.- Specified by:
getFetchDirection
in interfaceJDBCFetchConfiguration
-
setFetchDirection
public JDBCFetchConfiguration setFetchDirection(int direction)
Description copied from interface:JDBCFetchConfiguration
The fetch direction to use as a constant fromResultSet
. Defaults to theopenjpa.jdbc.FetchDirection
setting.- Specified by:
setFetchDirection
in interfaceJDBCFetchConfiguration
-
getLRSSize
public int getLRSSize()
Description copied from interface:JDBCFetchConfiguration
The large result set size mode to use. Defaults to theopenjpa.jdbc.LRSSize
setting.- Specified by:
getLRSSize
in interfaceJDBCFetchConfiguration
-
setLRSSize
public JDBCFetchConfiguration setLRSSize(int lrsSize)
Description copied from interface:JDBCFetchConfiguration
The large result set size mode to use. Defaults to theopenjpa.jdbc.LRSSize
setting.- Specified by:
setLRSSize
in interfaceJDBCFetchConfiguration
-
getJoinSyntax
public int getJoinSyntax()
Description copied from interface:JDBCFetchConfiguration
The join syntax to use.- Specified by:
getJoinSyntax
in interfaceJDBCFetchConfiguration
-
setJoinSyntax
public JDBCFetchConfiguration setJoinSyntax(int syntax)
Description copied from interface:JDBCFetchConfiguration
The join syntax to use.- Specified by:
setJoinSyntax
in interfaceJDBCFetchConfiguration
-
getJoins
public java.util.Set getJoins()
Description copied from interface:JDBCFetchConfiguration
Returns the names of the joins that this component will use when loading objects. Defaults to the empty set. This set is not thread safe.- Specified by:
getJoins
in interfaceJDBCFetchConfiguration
-
hasJoin
public boolean hasJoin(java.lang.String field)
Description copied from interface:JDBCFetchConfiguration
Return true if the given fully-qualified join has been added.- Specified by:
hasJoin
in interfaceJDBCFetchConfiguration
-
addJoin
public JDBCFetchConfiguration addJoin(java.lang.String field)
Description copied from interface:JDBCFetchConfiguration
Addsfield
to the set of fully-qualified field names to eagerly join when loading objects. Each class can have at most one to-many eagerly joined fields.- Specified by:
addJoin
in interfaceJDBCFetchConfiguration
-
addJoins
public JDBCFetchConfiguration addJoins(java.util.Collection fields)
Description copied from interface:JDBCFetchConfiguration
Addsfields
to the set of fully-qualified field names to eagerly join when loading objects. Each class can have at most one to-many eagerly joined fields.- Specified by:
addJoins
in interfaceJDBCFetchConfiguration
-
removeJoin
public JDBCFetchConfiguration removeJoin(java.lang.String field)
Description copied from interface:JDBCFetchConfiguration
Removesfield
to the set of fully-qualified field names to eagerly join when loading objects.- Specified by:
removeJoin
in interfaceJDBCFetchConfiguration
-
removeJoins
public JDBCFetchConfiguration removeJoins(java.util.Collection fields)
Description copied from interface:JDBCFetchConfiguration
Removesfields
from the set of fully-qualified field names to eagerly join when loading objects.- Specified by:
removeJoins
in interfaceJDBCFetchConfiguration
-
clearJoins
public JDBCFetchConfiguration clearJoins()
Description copied from interface:JDBCFetchConfiguration
Clears the set of field names to join when loading data.- Specified by:
clearJoins
in interfaceJDBCFetchConfiguration
-
getIsolation
public int getIsolation()
Description copied from interface:JDBCFetchConfiguration
The isolation level for queries issued to the database. This overrides the persistence-unit-wide
openjpa.jdbc.TransactionIsolation
value.Must be one of
Connection.TRANSACTION_NONE
,Connection.TRANSACTION_READ_UNCOMMITTED
,Connection.TRANSACTION_READ_COMMITTED
,Connection.TRANSACTION_REPEATABLE_READ
,Connection.TRANSACTION_SERIALIZABLE
, or -1 for the default connection level specified by the context in which this fetch configuration is being used.- Specified by:
getIsolation
in interfaceJDBCFetchConfiguration
-
setIsolation
public JDBCFetchConfiguration setIsolation(int level)
Description copied from interface:JDBCFetchConfiguration
The isolation level for queries issued to the database. This overrides the persistence-unit-wide
openjpa.jdbc.TransactionIsolation
value.Must be one of
Connection.TRANSACTION_NONE
,Connection.TRANSACTION_READ_UNCOMMITTED
,Connection.TRANSACTION_READ_COMMITTED
,Connection.TRANSACTION_REPEATABLE_READ
,Connection.TRANSACTION_SERIALIZABLE
, or -1 for the default connection level specified by the context in which this fetch configuration is being used.- Specified by:
setIsolation
in interfaceJDBCFetchConfiguration
-
traverseJDBC
public JDBCFetchConfiguration traverseJDBC(FieldMetaData fm)
Description copied from interface:JDBCFetchConfiguration
Convenience method to cast traversal to store-specific type.- Specified by:
traverseJDBC
in interfaceJDBCFetchConfiguration
-
getFetchInnerJoins
public java.util.Set getFetchInnerJoins()
Description copied from interface:JDBCFetchConfiguration
Returns the names of the inner fetch joins that this component will use when loading objects. Defaults to the empty set. This set is not thread safe.- Specified by:
getFetchInnerJoins
in interfaceJDBCFetchConfiguration
-
hasFetchInnerJoin
public boolean hasFetchInnerJoin(java.lang.String field)
Description copied from interface:JDBCFetchConfiguration
Return true if the given fully-qualified inner fetch join has been added.- Specified by:
hasFetchInnerJoin
in interfaceJDBCFetchConfiguration
-
addFetchInnerJoin
public JDBCFetchConfiguration addFetchInnerJoin(java.lang.String field)
Description copied from interface:JDBCFetchConfiguration
Addsfield
to the set of fully-qualified field names to eagerly join when loading objects. Each class can have at most one to-many eagerly joined fields.- Specified by:
addFetchInnerJoin
in interfaceJDBCFetchConfiguration
-
addFetchInnerJoins
public JDBCFetchConfiguration addFetchInnerJoins(java.util.Collection fields)
Description copied from interface:JDBCFetchConfiguration
Addsfields
to the set of fully-qualified field names to eagerly join when loading objects. Each class can have at most one to-many eagerly joined fields.- Specified by:
addFetchInnerJoins
in interfaceJDBCFetchConfiguration
-
setIgnoreDfgForFkSelect
public void setIgnoreDfgForFkSelect(boolean b)
Description copied from interface:JDBCFetchConfiguration
Affirms if foreign key for a relation field will be pre-fetched as part of the owning object irrespective of whether the field is included in the default fetch group of this fetch configuration.
By default, foreign key for a relation field is pre-fetched as part of the owning object only if the field in included in the default fetch group of this fetch configuration.- Specified by:
setIgnoreDfgForFkSelect
in interfaceJDBCFetchConfiguration
-
getIgnoreDfgForFkSelect
public boolean getIgnoreDfgForFkSelect()
Description copied from interface:JDBCFetchConfiguration
Affirms if foreign key for a relation field will be pre-fetched as part of the owning object irrespective of whether the field is included in the default fetch group of this fetch configuration.
By default, foreign key for a relation field is pre-fetched as part of the owning object only if the field in included in the default fetch group of this fetch configuration.- Specified by:
getIgnoreDfgForFkSelect
in interfaceJDBCFetchConfiguration
-
-