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:
Serializable
,DiscriminatorStrategy
,Strategy
Stores the class name along with each database object record.
- Author:
- Abe White
- See Also:
-
Field Summary
Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractDiscriminatorStrategy
disc, isFinal
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAlias()
Return the alias of this strategy.protected Class
Convert the given discriminator value to the corresponding class.protected Object
Return the discriminator value for the given type.protected int
Return the Java type code fromJavaTypes
for the discriminator values.void
loadSubclasses
(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 Details
-
ALIAS
- See Also:
-
-
Constructor Details
-
ClassNameDiscriminatorStrategy
public ClassNameDiscriminatorStrategy()
-
-
Method Details
-
getAlias
Description copied from interface:Strategy
Return the alias of this strategy. For custom strategies, return the full class name.- Specified by:
getAlias
in interfaceStrategy
- Overrides:
getAlias
in classAbstractStrategy
-
getJavaType
protected int getJavaType()Description copied from class:InValueDiscriminatorStrategy
Return the Java type code fromJavaTypes
for the discriminator values. This method is only used during mapping installation.- Specified by:
getJavaType
in classInValueDiscriminatorStrategy
-
getDiscriminatorValue
Description copied from class:InValueDiscriminatorStrategy
Return the discriminator value for the given type.- Specified by:
getDiscriminatorValue
in classInValueDiscriminatorStrategy
-
getClass
Description copied from class:InValueDiscriminatorStrategy
Convert the given discriminator value to the corresponding class.- Specified by:
getClass
in classInValueDiscriminatorStrategy
- Throws:
ClassNotFoundException
-
loadSubclasses
Description copied from class:AbstractDiscriminatorStrategy
By default, logs a warning that this discriminator cannot calculate its list of subclasses on its own.- Specified by:
loadSubclasses
in interfaceDiscriminatorStrategy
- Overrides:
loadSubclasses
in classAbstractDiscriminatorStrategy
- Throws:
SQLException
ClassNotFoundException
-