org.apache.openjpa.jdbc.meta.strats
Class FlatClassStrategy

java.lang.Object
  extended by org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
      extended by org.apache.openjpa.jdbc.meta.strats.AbstractClassStrategy
          extended by org.apache.openjpa.jdbc.meta.strats.FlatClassStrategy
All Implemented Interfaces:
Serializable, ClassStrategy, Strategy

public class FlatClassStrategy
extends AbstractClassStrategy

Mapping for classes mapped to their superclass table.

Author:
Abe White
See Also:
Serialized Form

Field Summary
static String ALIAS
           
 
Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractClassStrategy
cls
 
Constructor Summary
FlatClassStrategy()
           
 
Method Summary
 String getAlias()
          Return the alias of this strategy.
 boolean isPrimaryKeyObjectId(boolean hasAll)
          Return true if the this class' primary key columns correspond to the base class' primary key columns used to construct oid values.
 void map(boolean adapt)
          Map the owning mapping using this strategy.
 
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractClassStrategy
customLoad, customLoad, customLoad, joinSuperclass, setClassMapping, supportsEagerSelect
 
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
customDelete, customInsert, customUpdate, delete, initialize, insert, 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, insert, isCustomDelete, isCustomInsert, isCustomUpdate, update
 

Field Detail

ALIAS

public static final String ALIAS
See Also:
Constant Field Values
Constructor Detail

FlatClassStrategy

public FlatClassStrategy()
Method Detail

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

isPrimaryKeyObjectId

public boolean isPrimaryKeyObjectId(boolean hasAll)
Description copied from interface: ClassStrategy
Return true if the this class' primary key columns correspond to the base class' primary key columns used to construct oid values. Base classes always return true. Classes that join to the base class table, though, may not always join using the same columns the base class uses for oid values, or may not use all the columns. When performing a select, we will join down to the most-derived class that is identified by oid values. We cannot use non-primary key field values for joining during selects, because the field values to join on might be the ones we're trying to select! Similarly, we can only reconstruct oid values for selected objects using classes whose primary keys store oid values.

Specified by:
isPrimaryKeyObjectId in interface ClassStrategy
Overrides:
isPrimaryKeyObjectId in class AbstractClassStrategy
Parameters:
hasAll - if true, there must be a primary key column for every base class primary key column; if false the primary key must only match a subset of the base class primary key columns


Copyright © 2006-2007 Apache Software Foundation. All Rights Reserved.