Class AbstractDiscriminatorStrategy
- java.lang.Object
- 
- org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
- 
- org.apache.openjpa.jdbc.meta.strats.AbstractDiscriminatorStrategy
 
 
- 
- All Implemented Interfaces:
- java.io.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:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected DiscriminatordiscThe owning discriminator.protected booleanisFinalWhether the owning class is final.
 - 
Constructor SummaryConstructors Constructor Description AbstractDiscriminatorStrategy()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ClassgetClass(JDBCStore store, ClassMapping base, Result result)Return the class for the current result row.SQLBuffergetClassConditions(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.booleanhasClassConditions(ClassMapping base, boolean subs)Whether any class conditions are necessary.voidloadSubclasses(JDBCStore store)By default, logs a warning that this discriminator cannot calculate its list of subclasses on its own.booleanselect(Select sel, ClassMapping mapping)Select the data for this Discriminator.voidsetDiscriminator(Discriminator owner)Set the Discriminator that uses this strategy.- 
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategycustomDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, update
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.openjpa.jdbc.meta.StrategycustomDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, update
 
- 
 
- 
- 
- 
Field Detail- 
discprotected Discriminator disc The owning discriminator.
 - 
isFinalprotected boolean isFinal Whether the owning class is final.
 
- 
 - 
Method Detail- 
setDiscriminatorpublic void setDiscriminator(Discriminator owner) Description copied from interface:DiscriminatorStrategySet the Discriminator that uses this strategy. This will be called before use.- Specified by:
- setDiscriminatorin interface- DiscriminatorStrategy
 
 - 
selectpublic boolean select(Select sel, ClassMapping mapping) Description copied from interface:DiscriminatorStrategySelect the data for this Discriminator.- Specified by:
- selectin interface- DiscriminatorStrategy
- 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
 
 - 
loadSubclassespublic void loadSubclasses(JDBCStore store) throws java.sql.SQLException, java.lang.ClassNotFoundException By default, logs a warning that this discriminator cannot calculate its list of subclasses on its own.- Specified by:
- loadSubclassesin interface- DiscriminatorStrategy
- Throws:
- java.sql.SQLException
- java.lang.ClassNotFoundException
 
 - 
getClasspublic java.lang.Class getClass(JDBCStore store, ClassMapping base, Result result) throws java.sql.SQLException, java.lang.ClassNotFoundException Description copied from interface:DiscriminatorStrategyReturn the class for the current result row.- Specified by:
- getClassin interface- DiscriminatorStrategy
- Throws:
- java.sql.SQLException
- java.lang.ClassNotFoundException
 
 - 
hasClassConditionspublic boolean hasClassConditions(ClassMapping base, boolean subs) Description copied from interface:DiscriminatorStrategyWhether any class conditions are necessary.
 - 
getClassConditionspublic SQLBuffer getClassConditions(Select sel, Joins joins, ClassMapping base, boolean subs) 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 interface- DiscriminatorStrategy
 
 
- 
 
-