Save This Page
Home » apache-openjpa-1.1.0-source » org.apache.openjpa.jdbc » meta » [javadoc | source]
org.apache.openjpa.jdbc.meta
abstract public class: MappingInfo [javadoc | source]
java.lang.Object
   org.apache.openjpa.jdbc.meta.MappingInfo

All Implemented Interfaces:
    Serializable

Direct Known Subclasses:
    ClassMappingInfo, FieldMappingInfo, DiscriminatorMappingInfo, VersionMappingInfo, ValueMappingInfo

Base class storing raw mapping information; defines utility methods for converting raw mapping information to full mapping to the schema.
Nested Class Summary:
public static interface  MappingInfo.TableDefaults  Supplies default table information. 
public static interface  MappingInfo.ForeignKeyDefaults  Supplies default foreign key information. 
Field Summary
public static final  int JOIN_NONE     
public static final  int JOIN_FORWARD     
public static final  int JOIN_INVERSE     
Method from org.apache.openjpa.jdbc.meta.MappingInfo Summary:
assertNoForeignKey,   assertNoIndex,   assertNoJoin,   assertNoSchemaComponents,   assertNoUnique,   assertStrategy,   canForeignKey,   canIndex,   canUnique,   clear,   clear,   copy,   createColumns,   createForeignKey,   createIndex,   createTable,   createUnique,   getColumnIO,   getColumns,   getForeignKey,   getIndex,   getJoinDirection,   getStrategy,   getUnique,   hasSchemaComponents,   mergeColumn,   setCanForeignKey,   setCanIndex,   setCanUnique,   setColumnIO,   setColumns,   setForeignKey,   setIndex,   setJoinDirection,   setStrategy,   setUnique,   syncColumn,   syncColumns,   syncForeignKey,   syncIndex,   syncUnique
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.openjpa.jdbc.meta.MappingInfo Detail:
 public  void assertNoForeignKey(MetaDataContext context,
    boolean die) 
    Assert that the user did not try to place a foreign key on this mapping.
 public  void assertNoIndex(MetaDataContext context,
    boolean die) 
    Assert that the user did not try to place an index on this mapping.
 public  void assertNoJoin(MetaDataContext context,
    boolean die) 
    Assert that the user did not try to join.
 public  void assertNoSchemaComponents(MetaDataContext context,
    boolean die) 
    Assert that the user did not supply any columns, index, unique constraint, or foreign key for this mapping.
 public  void assertNoUnique(MetaDataContext context,
    boolean die) 
    Assert that the user did not try to place a unique constraint on this mapping.
 public  void assertStrategy(MetaDataContext context,
    Object contextStrat,
    Object expected,
    boolean die) 
    Assert that this info has the given strategy or no strategy.
 public boolean canForeignKey() 
    The user can mark columns as explicitly not having a foreign key.
 public boolean canIndex() 
    The user can mark columns as explicitly non-indexable.
 public boolean canUnique() 
    The user can mark columns as explicitly not having a unique constraint.
 public  void clear() 
    Clear all mapping information.
 protected  void clear(boolean canFlags) 
    Clear mapping information.
 public  void copy(MappingInfo info) 
    Copy missing info from the instance to this one.
 protected Column[] createColumns(MetaDataContext context,
    String prefix,
    Column[] tmplates,
    Table table,
    boolean adapt) 
    Retrieve/create columns on the given table by merging the given template information with any user-provided information.
 protected ForeignKey createForeignKey(MetaDataContext context,
    String prefix,
    List given,
    MappingInfo.ForeignKeyDefaults def,
    Table table,
    ClassMapping cls,
    ClassMapping rel,
    boolean inversable,
    boolean adapt) 
    Retrieve/create a foreign key (possibly logical) on the given columns by merging the given template information with any user-provided information.
 protected Index createIndex(MetaDataContext context,
    String prefix,
    Index tmplate,
    Column[] cols,
    boolean adapt) 
    Retrieve/create an index on the given columns by merging the given template information with any user-provided information.
 public Table createTable(MetaDataContext context,
    MappingInfo.TableDefaults def,
    String schemaName,
    String given,
    boolean adapt) 
    Find or generate a table for a mapping.
 protected Unique createUnique(MetaDataContext context,
    String prefix,
    Unique tmplate,
    Column[] cols,
    boolean adapt) 
    Retrieve/create a unique constraint on the given columns by merging the given template information with any user-provided information.
 public ColumnIO getColumnIO() 
 public List getColumns() 
    Raw column data.
 public ForeignKey getForeignKey() 
    Raw foreign key information.
 public Index getIndex() 
    Raw index.
 public int getJoinDirection() 
    Direction of the join that the columns of this mapping info form. This is usually automatically set by #createForeignKey . This flag is also expected to be set correctly prior to calls to #syncForeignKey if the join is inversed.
 public String getStrategy() 
    Mapping strategy name.
 public Unique getUnique() 
    Raw unique constraint information.
 public boolean hasSchemaComponents() 
    Return true if this info has columns, foreign key information, index information, etc.
 protected static Column mergeColumn(MetaDataContext context,
    String prefix,
    Column tmplate,
    boolean compat,
    Column given,
    Table table,
    boolean adapt,
    boolean fill) 
    Merge the given columns if possible.
 public  void setCanForeignKey(boolean fkable) 
    The user can mark columns as explicitly not having a foreign key.
 public  void setCanIndex(boolean indexable) 
    The user can mark columns as explicitly non-indexable.
 public  void setCanUnique(boolean uniquable) 
    The user can mark columns as explicitly not having a unique constraint.
 public  void setColumnIO(ColumnIO io) 
 public  void setColumns(List cols) 
    Raw column data.
 public  void setForeignKey(ForeignKey fk) 
    Raw foreign key information.
 public  void setIndex(Index idx) 
    Raw index.
 public  void setJoinDirection(int join) 
    Direction of the join that the columns of this mapping info form. This is usually automatically set by #createForeignKey . This flag is also expected to be set correctly prior to calls to #syncForeignKey if the join is inversed.
 public  void setStrategy(String strategy) 
    Mapping strategy name.
 public  void setUnique(Unique unq) 
    Raw unique constraint information.
 protected static Column syncColumn(MetaDataContext context,
    Column col,
    int num,
    boolean forceJDBCType,
    Table colTable,
    Table targetTable,
    Object target,
    boolean inverse) 
    Create a copy of the given column with the raw mapping information set correctly, and without settings that match defaults.
 protected  void syncColumns(MetaDataContext context,
    Column[] cols,
    boolean forceJDBCType) 
    Sets internal column information to match the given mapped columns.
 protected  void syncForeignKey(MetaDataContext context,
    ForeignKey fk,
    Table local,
    Table target) 
    Sets internal constraint and column information to match given mapped constraint.
 protected  void syncIndex(MetaDataContext context,
    Index idx) 
    Sets internal index information to match given mapped index.
 protected  void syncUnique(MetaDataContext context,
    Unique unq) 
    Sets internal constraint information to match given mapped constraint.