|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.openjpa.jdbc.meta.strats.AbstractStrategy
org.apache.openjpa.jdbc.meta.strats.AbstractDiscriminatorStrategy
org.apache.openjpa.jdbc.meta.strats.InValueDiscriminatorStrategy
public abstract class InValueDiscriminatorStrategy
Base discriminator strategy that determines the class of database records using a column holding a value mapped to a class, and limits SELECTs using an IN (...) statement.
| Field Summary |
|---|
| Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractDiscriminatorStrategy |
|---|
disc, isFinal |
| Constructor Summary | |
|---|---|
InValueDiscriminatorStrategy()
|
|
| Method Summary | |
|---|---|
Class |
getClass(JDBCStore store,
ClassMapping base,
Result res)
Return the class for the current result row. |
protected abstract Class |
getClass(Object val,
JDBCStore store)
Convert the given discriminator value to the corresponding class. |
SQLBuffer |
getClassConditions(Select sel,
Joins joins,
ClassMapping base,
boolean subclasses)
Return SQL to limit the classes selected as much as possible to the given base class, and optionally its subclasses. |
protected abstract Object |
getDiscriminatorValue(ClassMapping cls)
Return the discriminator value for the given type. |
protected abstract int |
getJavaType()
Return the Java type code from JavaTypes for the discriminator
values. |
boolean |
hasClassConditions(ClassMapping base,
boolean subclasses)
Whether any class conditions are necessary. |
void |
insert(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
Set values for the mapping into the proper rows. |
void |
map(boolean adapt)
Map the owning mapping using this strategy. |
boolean |
select(Select sel,
ClassMapping mapping)
Select the data for this Discriminator. |
| 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, getAlias, 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, getAlias, initialize, isCustomDelete, isCustomInsert, isCustomUpdate, update |
| Constructor Detail |
|---|
public InValueDiscriminatorStrategy()
| Method Detail |
|---|
protected abstract int getJavaType()
JavaTypes for the discriminator
values. This method is only used during mapping installation.
protected abstract Object getDiscriminatorValue(ClassMapping cls)
protected abstract Class getClass(Object val,
JDBCStore store)
throws ClassNotFoundException
ClassNotFoundExceptionpublic void map(boolean adapt)
Strategy
map in interface Strategymap in class AbstractStrategyadapt - if true, use the owning mapping's raw mapping info
to set its ORM data; if false, ORM data will already be set
public void insert(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
throws SQLException
Strategy
insert in interface Strategyinsert in class AbstractStrategySQLException
public boolean select(Select sel,
ClassMapping mapping)
DiscriminatorStrategy
select in interface DiscriminatorStrategyselect in class AbstractDiscriminatorStrategymapping - the known base class being selected; this may
not be the base class in the inheritance hierarchy
public Class getClass(JDBCStore store,
ClassMapping base,
Result res)
throws SQLException,
ClassNotFoundException
DiscriminatorStrategy
getClass in interface DiscriminatorStrategygetClass in class AbstractDiscriminatorStrategySQLException
ClassNotFoundException
public boolean hasClassConditions(ClassMapping base,
boolean subclasses)
DiscriminatorStrategy
hasClassConditions in interface DiscriminatorStrategyhasClassConditions in class AbstractDiscriminatorStrategyDiscriminatorStrategy.getClassConditions(org.apache.openjpa.jdbc.sql.Select, org.apache.openjpa.jdbc.sql.Joins, org.apache.openjpa.jdbc.meta.ClassMapping, boolean)
public SQLBuffer getClassConditions(Select sel,
Joins joins,
ClassMapping base,
boolean subclasses)
DiscriminatorStrategy
getClassConditions in interface DiscriminatorStrategygetClassConditions in class AbstractDiscriminatorStrategy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||