Class ClassNameDiscriminatorStrategy
- java.lang.Object
-
- org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
-
- org.apache.openjpa.jdbc.meta.strats.AbstractDiscriminatorStrategy
-
- org.apache.openjpa.jdbc.meta.strats.InValueDiscriminatorStrategy
-
- org.apache.openjpa.jdbc.meta.strats.ClassNameDiscriminatorStrategy
-
- All Implemented Interfaces:
java.io.Serializable,DiscriminatorStrategy,Strategy
public class ClassNameDiscriminatorStrategy extends InValueDiscriminatorStrategy
Stores the class name along with each database object record.- Author:
- Abe White
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringALIAS-
Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractDiscriminatorStrategy
disc, isFinal
-
-
Constructor Summary
Constructors Constructor Description ClassNameDiscriminatorStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAlias()Return the alias of this strategy.protected java.lang.ClassgetClass(java.lang.Object val, JDBCStore store)Convert the given discriminator value to the corresponding class.protected java.lang.ObjectgetDiscriminatorValue(ClassMapping cls)Return the discriminator value for the given type.protected intgetJavaType()Return the Java type code fromJavaTypesfor the discriminator values.voidloadSubclasses(JDBCStore store)By default, logs a warning that this discriminator cannot calculate its list of subclasses on its own.-
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.InValueDiscriminatorStrategy
getClass, getClassConditions, hasClassConditions, insert, map, select
-
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractDiscriminatorStrategy
setDiscriminator
-
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
customDelete, customInsert, customUpdate, delete, initialize, isCustomDelete, isCustomInsert, isCustomUpdate, 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, initialize, isCustomDelete, isCustomInsert, isCustomUpdate, update
-
-
-
-
Field Detail
-
ALIAS
public static final java.lang.String ALIAS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAlias
public java.lang.String 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
-
getJavaType
protected int getJavaType()
Description copied from class:InValueDiscriminatorStrategyReturn the Java type code fromJavaTypesfor the discriminator values. This method is only used during mapping installation.- Specified by:
getJavaTypein classInValueDiscriminatorStrategy
-
getDiscriminatorValue
protected java.lang.Object getDiscriminatorValue(ClassMapping cls)
Description copied from class:InValueDiscriminatorStrategyReturn the discriminator value for the given type.- Specified by:
getDiscriminatorValuein classInValueDiscriminatorStrategy
-
getClass
protected java.lang.Class getClass(java.lang.Object val, JDBCStore store) throws java.lang.ClassNotFoundExceptionDescription copied from class:InValueDiscriminatorStrategyConvert the given discriminator value to the corresponding class.- Specified by:
getClassin classInValueDiscriminatorStrategy- Throws:
java.lang.ClassNotFoundException
-
loadSubclasses
public void loadSubclasses(JDBCStore store) throws java.sql.SQLException, java.lang.ClassNotFoundException
Description copied from class:AbstractDiscriminatorStrategyBy default, logs a warning that this discriminator cannot calculate its list of subclasses on its own.- Specified by:
loadSubclassesin interfaceDiscriminatorStrategy- Overrides:
loadSubclassesin classAbstractDiscriminatorStrategy- Throws:
java.sql.SQLExceptionjava.lang.ClassNotFoundException
-
-