Class SubclassJoinDiscriminatorStrategy
java.lang.Object
org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
org.apache.openjpa.jdbc.meta.strats.AbstractDiscriminatorStrategy
org.apache.openjpa.jdbc.meta.strats.SubclassJoinDiscriminatorStrategy
- All Implemented Interfaces:
Serializable,DiscriminatorStrategy,Strategy
Discriminator strategy that outer joins to all possible subclass tables
to determine the class of an instance. This indicator type should only
be used with vertical inheritance hierarchies.
- Author:
- Abe White
- See Also:
-
Field Summary
FieldsFields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractDiscriminatorStrategy
disc, isFinal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAlias()Return the alias of this strategy.getClass(JDBCStore store, ClassMapping base, Result res) Return the class for the current result row.getClassConditions(Select sel, Joins joins, ClassMapping base, boolean subclasses) Return SQL to limit the classes selected as much as possible to the given base class, and optionally its subclasses.booleanhasClassConditions(ClassMapping base, boolean subclasses) Whether any class conditions are necessary.voidmap(boolean adapt) Map the owning mapping using this strategy.booleanselect(Select sel, ClassMapping mapping) Select the data for this Discriminator.Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractDiscriminatorStrategy
loadSubclasses, setDiscriminatorMethods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
customDelete, customInsert, customUpdate, delete, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.openjpa.jdbc.meta.Strategy
customDelete, customInsert, customUpdate, delete, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, update
-
Field Details
-
ALIAS
- See Also:
-
-
Constructor Details
-
SubclassJoinDiscriminatorStrategy
public SubclassJoinDiscriminatorStrategy()
-
-
Method Details
-
getAlias
Description copied from interface:StrategyReturn the alias of this strategy. For custom strategies, return the full class name.- Specified by:
getAliasin interfaceStrategy- Overrides:
getAliasin classAbstractStrategy
-
map
public void map(boolean adapt) Description copied from interface:StrategyMap the owning mapping using this strategy.- Specified by:
mapin interfaceStrategy- Overrides:
mapin classAbstractStrategy- Parameters:
adapt- if true, use the owning mapping's raw mapping info to set its ORM data; if false, ORM data will already be set
-
select
Description copied from interface:DiscriminatorStrategySelect the data for this Discriminator.- Specified by:
selectin interfaceDiscriminatorStrategy- Overrides:
selectin classAbstractDiscriminatorStrategymapping- 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
-
getClass
public Class getClass(JDBCStore store, ClassMapping base, Result res) throws SQLException, ClassNotFoundException Description copied from interface:DiscriminatorStrategyReturn the class for the current result row.- Specified by:
getClassin interfaceDiscriminatorStrategy- Overrides:
getClassin classAbstractDiscriminatorStrategy- Throws:
SQLExceptionClassNotFoundException
-
hasClassConditions
Description copied from interface:DiscriminatorStrategyWhether any class conditions are necessary.- Specified by:
hasClassConditionsin interfaceDiscriminatorStrategy- Overrides:
hasClassConditionsin classAbstractDiscriminatorStrategy- See Also:
-
getClassConditions
Description copied from interface:DiscriminatorStrategyReturn 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:
getClassConditionsin interfaceDiscriminatorStrategy- Overrides:
getClassConditionsin classAbstractDiscriminatorStrategy
-