Class ValueMapDiscriminatorStrategy
- 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.ValueMapDiscriminatorStrategy
-
- All Implemented Interfaces:
java.io.Serializable
,DiscriminatorStrategy
,Strategy
public class ValueMapDiscriminatorStrategy extends InValueDiscriminatorStrategy
Maps metadata-given values to classes.- Author:
- Abe White
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ALIAS
-
Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractDiscriminatorStrategy
disc, isFinal
-
-
Constructor Summary
Constructors Constructor Description ValueMapDiscriminatorStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAlias()
Return the alias of this strategy.protected java.lang.Class
getClass(java.lang.Object val, JDBCStore store)
Convert the given discriminator value to the corresponding class.protected java.lang.Object
getDiscriminatorValue(ClassMapping cls)
Return the discriminator value for the given type.protected int
getJavaType()
Return the Java type code fromJavaTypes
for the discriminator values.void
map(boolean adapt)
Map the owning mapping using this strategy.-
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.InValueDiscriminatorStrategy
getClass, getClassConditions, hasClassConditions, insert, select
-
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractDiscriminatorStrategy
loadSubclasses, 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: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
protected java.lang.Object getDiscriminatorValue(ClassMapping cls)
Description copied from class:InValueDiscriminatorStrategy
Return the discriminator value for the given type.- Specified by:
getDiscriminatorValue
in classInValueDiscriminatorStrategy
-
getClass
protected java.lang.Class getClass(java.lang.Object val, JDBCStore store) throws java.lang.ClassNotFoundException
Description copied from class:InValueDiscriminatorStrategy
Convert the given discriminator value to the corresponding class.- Specified by:
getClass
in classInValueDiscriminatorStrategy
- Throws:
java.lang.ClassNotFoundException
-
map
public void map(boolean adapt)
Description copied from interface:Strategy
Map the owning mapping using this strategy.- Specified by:
map
in interfaceStrategy
- Overrides:
map
in classInValueDiscriminatorStrategy
- 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
-
-