Class AbstractDiscriminatorStrategy
java.lang.Object
org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
org.apache.openjpa.jdbc.meta.strats.AbstractDiscriminatorStrategy
- All Implemented Interfaces:
Serializable
,DiscriminatorStrategy
,Strategy
- Direct Known Subclasses:
InValueDiscriminatorStrategy
,NoneDiscriminatorStrategy
,SubclassJoinDiscriminatorStrategy
,SuperclassDiscriminatorStrategy
public abstract class AbstractDiscriminatorStrategy
extends AbstractStrategy
implements DiscriminatorStrategy
No-op strategy for easy extension.
- Author:
- Abe White
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Discriminator
The owning discriminator.protected boolean
Whether the owning class is final. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetClass
(JDBCStore store, ClassMapping base, Result result) Return the class for the current result row.getClassConditions
(Select sel, Joins joins, ClassMapping base, boolean subs) Return SQL to limit the classes selected as much as possible to the given base class, and optionally its subclasses.boolean
hasClassConditions
(ClassMapping base, boolean subs) Whether any class conditions are necessary.void
loadSubclasses
(JDBCStore store) By default, logs a warning that this discriminator cannot calculate its list of subclasses on its own.boolean
select
(Select sel, ClassMapping mapping) Select the data for this Discriminator.void
setDiscriminator
(Discriminator owner) Set the Discriminator that uses this strategy.Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
customDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, update
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.openjpa.jdbc.meta.Strategy
customDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, update
-
Field Details
-
disc
The owning discriminator. -
isFinal
protected boolean isFinalWhether the owning class is final.
-
-
Constructor Details
-
AbstractDiscriminatorStrategy
public AbstractDiscriminatorStrategy()
-
-
Method Details
-
setDiscriminator
Description copied from interface:DiscriminatorStrategy
Set the Discriminator that uses this strategy. This will be called before use.- Specified by:
setDiscriminator
in interfaceDiscriminatorStrategy
-
select
Description copied from interface:DiscriminatorStrategy
Select the data for this Discriminator.- Specified by:
select
in interfaceDiscriminatorStrategy
mapping
- the known base class being selected; this may not be the base class in the inheritance hierarchy- Returns:
- true if anything was selected; false otherwise
-
loadSubclasses
By default, logs a warning that this discriminator cannot calculate its list of subclasses on its own.- Specified by:
loadSubclasses
in interfaceDiscriminatorStrategy
- Throws:
SQLException
ClassNotFoundException
-
getClass
public Class getClass(JDBCStore store, ClassMapping base, Result result) throws SQLException, ClassNotFoundException Description copied from interface:DiscriminatorStrategy
Return the class for the current result row.- Specified by:
getClass
in interfaceDiscriminatorStrategy
- Throws:
SQLException
ClassNotFoundException
-
hasClassConditions
Description copied from interface:DiscriminatorStrategy
Whether any class conditions are necessary. -
getClassConditions
Description copied from interface:DiscriminatorStrategy
Return SQL to limit the classes selected as much as possible to the given base class, and optionally its subclasses. The select and joins instances are supplied in order to get column aliases.- Specified by:
getClassConditions
in interfaceDiscriminatorStrategy
-