org.apache.openjpa.jdbc.meta.strats
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:
- DiscriminatorStrategy, Strategy
public class SubclassJoinDiscriminatorStrategy
- extends AbstractDiscriminatorStrategy
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ALIAS
public static final String ALIAS
- See Also:
- Constant Field Values
SubclassJoinDiscriminatorStrategy
public SubclassJoinDiscriminatorStrategy()
getAlias
public 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 interface Strategy
- Overrides:
getAlias
in class AbstractStrategy
map
public void map(boolean adapt)
- Description copied from interface:
Strategy
- Map the owning mapping using this strategy.
- Specified by:
map
in interface Strategy
- Overrides:
map
in class AbstractStrategy
- 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
public boolean select(Select sel,
ClassMapping mapping)
- Description copied from interface:
DiscriminatorStrategy
- Select the data for this Discriminator.
- Specified by:
select
in interface DiscriminatorStrategy
- Overrides:
select
in class AbstractDiscriminatorStrategy
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
getClass
public Class getClass(JDBCStore store,
ClassMapping base,
Result res)
throws SQLException,
ClassNotFoundException
- Description copied from interface:
DiscriminatorStrategy
- Return the class for the current result row.
- Specified by:
getClass
in interface DiscriminatorStrategy
- Overrides:
getClass
in class AbstractDiscriminatorStrategy
- Throws:
SQLException
ClassNotFoundException
getClassConditions
public SQLBuffer getClassConditions(Select sel,
Joins joins,
ClassMapping base,
boolean subclasses)
- Description copied from interface:
DiscriminatorStrategy
- Return SQL to limit the classes selected as much as possible to the
given base class, and optionally its subclasses. Return null if
no conditions needed. The select and joins instances are supplied
in order to get column aliases.
- Specified by:
getClassConditions
in interface DiscriminatorStrategy
- Overrides:
getClassConditions
in class AbstractDiscriminatorStrategy
Copyright © 2006 Apache Software Foundation. All Rights Reserved.