org.apache.openjpa.jdbc.meta
Class MappingDefaultsImpl

java.lang.Object
  extended by org.apache.openjpa.jdbc.meta.MappingDefaultsImpl
All Implemented Interfaces:
MappingDefaults, org.apache.openjpa.lib.conf.Configurable

public class MappingDefaultsImpl
extends java.lang.Object
implements MappingDefaults, org.apache.openjpa.lib.conf.Configurable

Default implementation of MappingDefaults.

Author:
Abe White

Field Summary
protected  DBDictionary dict
           
 
Constructor Summary
MappingDefaultsImpl()
           
 
Method Summary
protected  boolean areAllPrimaryKeyColumns(Column[] cols)
          Return whether all the given columns are primary key columns.
protected  void correctName(Table table, Column col)
          Correct the given column's name.
 boolean defaultMissingInfo()
          Whether to fill in missing mapping information at runtime with the default values supplied by this plugin.
 void endConfiguration()
           
 boolean getAddNullIndicator()
          Whether to add a synthetic null indicator column to embedded mappings by default.
 java.lang.String getBaseClassStrategy()
          Default base class strategy alias.
 java.lang.String getDataStoreIdColumnName()
          Default base name for datastore identity columns, or null to the mapping's built-in name.
 boolean getDeferConstraints()
          Whether to defer constraints by default.
 java.lang.String getDiscriminatorColumnName()
          Default base name for discriminator columns, or null to the mapping's built-in name.
 java.lang.String getDiscriminatorStrategy()
          Default discriminator strategy alias.
 java.lang.Object getDiscriminatorValue(Discriminator disc, boolean adapt)
          Return the default discriminator value for the given instance.
 java.lang.String getFieldStrategy(java.lang.String valueType)
          Association of a field value type name with the handler or strategy class name.
 ForeignKey getForeignKey(ValueMapping vm, java.lang.String name, Table local, Table foreign, boolean inverse)
          Return a default foreign key for the join from this value to its related type, or null for a logical foreign key only.
 int getForeignKeyDeleteAction()
          Default foreign key action for relation keys.
 Index getIndex(Discriminator disc, Table table, Column[] cols)
          Return a default index for the discriminator, or null if the discriminator columns should not be indexed by default.
 Index getIndex(ValueMapping vm, java.lang.String name, Table table, Column[] cols)
          Return a default index for the value, or null if the value columns should not be indexed by default.
 Index getIndex(Version vers, Table table, Column[] cols)
          Return a default index for the version, or null if the version columns should not be indexed by default.
 boolean getIndexDiscriminator()
          Whether to index discriminator columns by default.
 boolean getIndexLogicalForeignKeys()
          Whether to index logical foreign keys by default.
protected  java.lang.String getIndexName(java.lang.String name, Table table, Column[] cols)
          Generate an index name.
 boolean getIndexVersion()
          Whether to index version columns by default.
 ForeignKey getJoinForeignKey(ClassMapping cls, Table local, Table foreign)
          Return a default foreign key for the join from this class' table to its superclass' table, or null for a logical foreign key only.
 ForeignKey getJoinForeignKey(FieldMapping fm, Table local, Table foreign)
          Return a default foreign key for the join from this field's table to its defining class' table, or null for a logical foreign key only.
 int getJoinForeignKeyDeleteAction()
          Default foreign key action for join keys.
 Index getJoinIndex(FieldMapping fm, Table table, Column[] cols)
          Return a default index for the join, or null if the join columns should not be indexed by default.
 Unique getJoinUnique(FieldMapping fm, Table table, Column[] cols)
          Return a default constraint for the join, or null if the join columns should not be constrained by default.
 java.lang.String getNullIndicatorColumnName()
          Default base name for null indicator columns, or null to the mapping's built-in name.
 java.lang.String getOrderColumnName()
          Default base name for order columns, or null to the mapping's built-in name.
 boolean getOrderLists()
          Whether to order lists and arrays using a dedicated ordering column by default.
 java.lang.String getPrimaryKeyName(ClassMapping cm, Table table)
          Return the name of the primary key for the table of the given class, or null for database default.
 boolean getStoreEnumOrdinal()
          Whether to store enums as the ordinal value rather than the enum name.
 boolean getStoreUnmappedObjectIdString()
          Whether to store a relation to an unmapped class by stringifying the oid of the related object, rather than storing primary key values.
 java.lang.Object getStrategy(ClassMapping cls, boolean adapt)
          Default mapping strategy when there is no explicit strategy and no hierarchy strategy given.
 java.lang.Object getStrategy(Discriminator disc, boolean adapt)
          Default discriminator mapping strategy when there is no explicit strategy.
 java.lang.Object getStrategy(ValueMapping vm, java.lang.Class type, boolean adapt)
          Custom handler or strategy for the given field, or null if none has been registered.
 java.lang.Object getStrategy(Version vers, boolean adapt)
          Default version mapping strategy when there is no explicit strategy.
 java.lang.String getSubclassStrategy()
          Default subclass strategy alias.
 java.lang.String getTableName(ClassMapping cls, Schema schema)
          Return the default table name for the given class.
 java.lang.String getTableName(FieldMapping fm, Schema schema)
          Return the default secondary table name for the given field.
 Unique getUnique(ValueMapping vm, java.lang.String name, Table table, Column[] cols)
          Return a default constraint for the value, or null if the value columns should not be constrained by default.
 java.lang.String getVersionColumnName()
          Default base name for version identity columns, or null to the mapping's built-in name.
 java.lang.String getVersionStrategy()
          Default version strategy alias.
 void installPrimaryKey(FieldMapping fm, Table table)
          If desired, install a primary key on the given secondary table.
 void populateColumns(Discriminator disc, Table table, Column[] cols)
          Fill in default information for the given discriminator columns.
 void populateColumns(ValueMapping vm, java.lang.String name, Table table, Column[] cols)
          Fill in default information for the given value columns.
 void populateColumns(Version vers, Table table, Column[] cols)
          Fill in default information for the given version columns.
 void populateDataStoreIdColumns(ClassMapping cls, Table table, Column[] cols)
          Fill in default information for the given datastore identity columns.
 void populateForeignKeyColumn(ValueMapping vm, java.lang.String name, Table local, Table foreign, Column col, java.lang.Object target, boolean inverse, int pos, int cols)
          Fill in default information for the given column used to join a value to its related type.
 void populateJoinColumn(ClassMapping cm, Table local, Table foreign, Column col, java.lang.Object target, int pos, int cols)
          Fill in default information for the given column used to join a class to its superclass table.
 void populateJoinColumn(FieldMapping fm, Table local, Table foreign, Column col, java.lang.Object target, int pos, int cols)
          Fill in default information for the given column used to join a field to its defining class' table.
 boolean populateNullIndicatorColumns(ValueMapping vm, java.lang.String name, Table table, Column[] cols)
          Fill in default information for the given null indicator columns.
 boolean populateOrderColumns(FieldMapping fm, Table table, Column[] cols)
          Fill in default information for the given order columns.
 void setAddNullIndicator(boolean addNullInd)
          Whether to add a synthetic null indicator column to embedded mappings by default.
 void setBaseClassStrategy(java.lang.String baseClassStrategy)
          Default base class strategy alias.
 void setConfiguration(org.apache.openjpa.lib.conf.Configuration conf)
           
 void setDataStoreIdColumnName(java.lang.String dsIdName)
          Default base name for datastore identity columns, or null to the mapping's built-in name.
 void setDefaultMissingInfo(boolean defMissing)
           
 void setDeferConstraints(boolean defer)
          Whether to defer constraints by default.
 void setDiscriminatorColumnName(java.lang.String discName)
          Default base name for discriminator columns, or null to the mapping's built-in name.
 void setDiscriminatorStrategy(java.lang.String discStrategy)
          Default discriminator strategy alias.
 void setFieldStrategies(java.lang.String fieldMapString)
          Property string mapping field type names to value handler or field mapping class names.
 void setFieldStrategy(java.lang.String valueType, java.lang.String handlerType)
          Association of a field value type name with the handler or strategy class name.
 void setForeignKeyDeleteAction(int fkAction)
          Default foreign key action for relation keys.
 void setForeignKeyDeleteAction(java.lang.String fkAction)
          Default foreign key action name for relation keys.
 void setIndexDiscriminator(boolean indexDisc)
          Whether to index discriminator columns by default.
 void setIndexLogicalForeignKeys(boolean indexFK)
          Whether to index logical foreign keys by default.
 void setIndexVersion(boolean indexVers)
          Whether to index version columns by default.
 void setJoinForeignKeyDeleteAction(int joinFKAction)
          Default foreign key action for join keys.
 void setJoinForeignKeyDeleteAction(java.lang.String joinFKAction)
          Default foreign key action name for join keys.
 void setNullIndicatorColumnName(java.lang.String nullIndName)
          Default base name for null indicator columns, or null to the mapping's built-in name.
 void setOrderColumnName(java.lang.String orderName)
          Default base name for order columns, or null to the mapping's built-in name.
 void setOrderLists(boolean orderLists)
          Whether to order lists and arrays using a dedicated ordering column by default.
 void setStoreEnumOrdinal(boolean ordinal)
          Whether to store enums as the ordinal value rather than the enum name.
 void setStoreUnmappedObjectIdString(boolean stringify)
          Whether to store a relation to an unmapped class by stringifying the oid of the related object, rather than storing primary key values.
 void setSubclassStrategy(java.lang.String subclassStrategy)
          Default subclass strategy alias.
 void setUseClassCriteria(boolean classCriteria)
           
 void setVersionColumnName(java.lang.String versName)
          Default base name for version identity columns, or null to the mapping's built-in name.
 void setVersionStrategy(java.lang.String versionStrategy)
          Default version strategy alias.
 void startConfiguration()
           
 boolean useClassCriteria()
          The default for whether relations use the related object's expected class as part of the join criteria.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dict

protected DBDictionary dict
Constructor Detail

MappingDefaultsImpl

public MappingDefaultsImpl()
Method Detail

getBaseClassStrategy

public java.lang.String getBaseClassStrategy()
Default base class strategy alias.


setBaseClassStrategy

public void setBaseClassStrategy(java.lang.String baseClassStrategy)
Default base class strategy alias.


getSubclassStrategy

public java.lang.String getSubclassStrategy()
Default subclass strategy alias.


setSubclassStrategy

public void setSubclassStrategy(java.lang.String subclassStrategy)
Default subclass strategy alias.


getVersionStrategy

public java.lang.String getVersionStrategy()
Default version strategy alias.


setVersionStrategy

public void setVersionStrategy(java.lang.String versionStrategy)
Default version strategy alias.


getDiscriminatorStrategy

public java.lang.String getDiscriminatorStrategy()
Default discriminator strategy alias.


setDiscriminatorStrategy

public void setDiscriminatorStrategy(java.lang.String discStrategy)
Default discriminator strategy alias.


setFieldStrategies

public void setFieldStrategies(java.lang.String fieldMapString)
Property string mapping field type names to value handler or field mapping class names. For auto-configuration.


setFieldStrategy

public void setFieldStrategy(java.lang.String valueType,
                             java.lang.String handlerType)
Association of a field value type name with the handler or strategy class name.


getFieldStrategy

public java.lang.String getFieldStrategy(java.lang.String valueType)
Association of a field value type name with the handler or strategy class name.


getStoreEnumOrdinal

public boolean getStoreEnumOrdinal()
Whether to store enums as the ordinal value rather than the enum name. Defaults to false.


setStoreEnumOrdinal

public void setStoreEnumOrdinal(boolean ordinal)
Whether to store enums as the ordinal value rather than the enum name. Defaults to false.


getStoreUnmappedObjectIdString

public boolean getStoreUnmappedObjectIdString()
Whether to store a relation to an unmapped class by stringifying the oid of the related object, rather than storing primary key values.


setStoreUnmappedObjectIdString

public void setStoreUnmappedObjectIdString(boolean stringify)
Whether to store a relation to an unmapped class by stringifying the oid of the related object, rather than storing primary key values.


getJoinForeignKeyDeleteAction

public int getJoinForeignKeyDeleteAction()
Default foreign key action for join keys. Defaults to logical keys.


setJoinForeignKeyDeleteAction

public void setJoinForeignKeyDeleteAction(int joinFKAction)
Default foreign key action for join keys. Defaults to logical keys.


setJoinForeignKeyDeleteAction

public void setJoinForeignKeyDeleteAction(java.lang.String joinFKAction)
Default foreign key action name for join keys. Used in auto configuration.


getForeignKeyDeleteAction

public int getForeignKeyDeleteAction()
Default foreign key action for relation keys. Defaults to logical keys.


setForeignKeyDeleteAction

public void setForeignKeyDeleteAction(int fkAction)
Default foreign key action for relation keys. Defaults to logical keys.


setForeignKeyDeleteAction

public void setForeignKeyDeleteAction(java.lang.String fkAction)
Default foreign key action name for relation keys. Used in auto configuration.


getIndexLogicalForeignKeys

public boolean getIndexLogicalForeignKeys()
Whether to index logical foreign keys by default. Defaults to true.


setIndexLogicalForeignKeys

public void setIndexLogicalForeignKeys(boolean indexFK)
Whether to index logical foreign keys by default. Defaults to true.


getIndexDiscriminator

public boolean getIndexDiscriminator()
Whether to index discriminator columns by default. Defaults to true.


setIndexDiscriminator

public void setIndexDiscriminator(boolean indexDisc)
Whether to index discriminator columns by default. Defaults to true.


getIndexVersion

public boolean getIndexVersion()
Whether to index version columns by default. Defaults to true.


setIndexVersion

public void setIndexVersion(boolean indexVers)
Whether to index version columns by default. Defaults to true.


getOrderLists

public boolean getOrderLists()
Whether to order lists and arrays using a dedicated ordering column by default.


setOrderLists

public void setOrderLists(boolean orderLists)
Whether to order lists and arrays using a dedicated ordering column by default.


getAddNullIndicator

public boolean getAddNullIndicator()
Whether to add a synthetic null indicator column to embedded mappings by default.


setAddNullIndicator

public void setAddNullIndicator(boolean addNullInd)
Whether to add a synthetic null indicator column to embedded mappings by default.


getDeferConstraints

public boolean getDeferConstraints()
Whether to defer constraints by default. Defaults to false.


setDeferConstraints

public void setDeferConstraints(boolean defer)
Whether to defer constraints by default. Defaults to false.


getDataStoreIdColumnName

public java.lang.String getDataStoreIdColumnName()
Default base name for datastore identity columns, or null to the mapping's built-in name.


setDataStoreIdColumnName

public void setDataStoreIdColumnName(java.lang.String dsIdName)
Default base name for datastore identity columns, or null to the mapping's built-in name.


getVersionColumnName

public java.lang.String getVersionColumnName()
Default base name for version identity columns, or null to the mapping's built-in name. This name may be combined with lock group names.


setVersionColumnName

public void setVersionColumnName(java.lang.String versName)
Default base name for version identity columns, or null to the mapping's built-in name. This name may be combined with lock group names.


getDiscriminatorColumnName

public java.lang.String getDiscriminatorColumnName()
Default base name for discriminator columns, or null to the mapping's built-in name.


setDiscriminatorColumnName

public void setDiscriminatorColumnName(java.lang.String discName)
Default base name for discriminator columns, or null to the mapping's built-in name.


getOrderColumnName

public java.lang.String getOrderColumnName()
Default base name for order columns, or null to the mapping's built-in name.


setOrderColumnName

public void setOrderColumnName(java.lang.String orderName)
Default base name for order columns, or null to the mapping's built-in name.


getNullIndicatorColumnName

public java.lang.String getNullIndicatorColumnName()
Default base name for null indicator columns, or null to the mapping's built-in name.


setNullIndicatorColumnName

public void setNullIndicatorColumnName(java.lang.String nullIndName)
Default base name for null indicator columns, or null to the mapping's built-in name.


defaultMissingInfo

public boolean defaultMissingInfo()
Description copied from interface: MappingDefaults
Whether to fill in missing mapping information at runtime with the default values supplied by this plugin. A value of false means that all mapping information must be present at runtime.

Specified by:
defaultMissingInfo in interface MappingDefaults

setDefaultMissingInfo

public void setDefaultMissingInfo(boolean defMissing)

useClassCriteria

public boolean useClassCriteria()
Description copied from interface: MappingDefaults
The default for whether relations use the related object's expected class as part of the join criteria.

Specified by:
useClassCriteria in interface MappingDefaults

setUseClassCriteria

public void setUseClassCriteria(boolean classCriteria)

getStrategy

public java.lang.Object getStrategy(ClassMapping cls,
                                    boolean adapt)
Description copied from interface: MappingDefaults
Default mapping strategy when there is no explicit strategy and no hierarchy strategy given.

Specified by:
getStrategy in interface MappingDefaults
Parameters:
cls - the class; will not be mapped, but superclass and raw MappingInfo will be available
adapt - whether we can adapt the mapping or schema
Returns:
the strategy alias or a strategy instance, or null

getStrategy

public java.lang.Object getStrategy(Version vers,
                                    boolean adapt)
Description copied from interface: MappingDefaults
Default version mapping strategy when there is no explicit strategy.

Specified by:
getStrategy in interface MappingDefaults
Parameters:
vers - the version; will not be mapped, but raw MappingInfo will be available
adapt - whether we can adapt the mapping or schema
Returns:
the strategy alias or a strategy instance, or null

getStrategy

public java.lang.Object getStrategy(Discriminator disc,
                                    boolean adapt)
Description copied from interface: MappingDefaults
Default discriminator mapping strategy when there is no explicit strategy.

Specified by:
getStrategy in interface MappingDefaults
Parameters:
disc - the discriminator; will not be mapped, but raw MappingInfo will be available
adapt - whether we can adapt the mapping or schema
Returns:
the strategy alias or a strategy instance, or null

getStrategy

public java.lang.Object getStrategy(ValueMapping vm,
                                    java.lang.Class type,
                                    boolean adapt)
Description copied from interface: MappingDefaults
Custom handler or strategy for the given field, or null if none has been registered.

Specified by:
getStrategy in interface MappingDefaults
Parameters:
vm - the value mapping; will not be mapped, but raw MappingInfo will be available
type - the value type
adapt - whether we can adapt the mapping or schema
Returns:
the handler/strategy alias or instance, or null

getDiscriminatorValue

public java.lang.Object getDiscriminatorValue(Discriminator disc,
                                              boolean adapt)
Description copied from interface: MappingDefaults
Return the default discriminator value for the given instance.

Specified by:
getDiscriminatorValue in interface MappingDefaults

getTableName

public java.lang.String getTableName(ClassMapping cls,
                                     Schema schema)
Description copied from interface: MappingDefaults
Return the default table name for the given class. This method is only called for classes mapped to their own table.

Specified by:
getTableName in interface MappingDefaults

getTableName

public java.lang.String getTableName(FieldMapping fm,
                                     Schema schema)
Description copied from interface: MappingDefaults
Return the default secondary table name for the given field. This method is only called for fields whose strategy requires a secondary table.

Specified by:
getTableName in interface MappingDefaults

populateDataStoreIdColumns

public void populateDataStoreIdColumns(ClassMapping cls,
                                       Table table,
                                       Column[] cols)
Description copied from interface: MappingDefaults
Fill in default information for the given datastore identity columns. The columns' name and Java type will already be populated with generic defaults that may be replaced.

Specified by:
populateDataStoreIdColumns in interface MappingDefaults

correctName

protected void correctName(Table table,
                           Column col)
Correct the given column's name.


populateColumns

public void populateColumns(Version vers,
                            Table table,
                            Column[] cols)
Description copied from interface: MappingDefaults
Fill in default information for the given version columns. The columns' name and Java type will already be populated with generic defaults that may be replaced.

Specified by:
populateColumns in interface MappingDefaults

populateColumns

public void populateColumns(Discriminator disc,
                            Table table,
                            Column[] cols)
Description copied from interface: MappingDefaults
Fill in default information for the given discriminator columns. The columns' name and Java type will already be populated with generic defaults that may be replaced.

Specified by:
populateColumns in interface MappingDefaults

populateJoinColumn

public void populateJoinColumn(ClassMapping cm,
                               Table local,
                               Table foreign,
                               Column col,
                               java.lang.Object target,
                               int pos,
                               int cols)
Description copied from interface: MappingDefaults
Fill in default information for the given column used to join a class to its superclass table. The column will be a clone of the target column, or have its name and Java type set in the case of a constant target.

Specified by:
populateJoinColumn in interface MappingDefaults
target - the target of this column in the join; may be another column or a constant value
pos - the index of this column in the logical foreign key
cols - the number of columns in the logical foreign key

populateJoinColumn

public void populateJoinColumn(FieldMapping fm,
                               Table local,
                               Table foreign,
                               Column col,
                               java.lang.Object target,
                               int pos,
                               int cols)
Description copied from interface: MappingDefaults
Fill in default information for the given column used to join a field to its defining class' table. The column will be a clone of the target column, or have its name and Java type set in the case of a constant target.

Specified by:
populateJoinColumn in interface MappingDefaults
target - the target of this column in the join; may be another column or a constant value
pos - the index of this column in the logical foreign key
cols - the number of columns in the logical foreign key

populateForeignKeyColumn

public void populateForeignKeyColumn(ValueMapping vm,
                                     java.lang.String name,
                                     Table local,
                                     Table foreign,
                                     Column col,
                                     java.lang.Object target,
                                     boolean inverse,
                                     int pos,
                                     int cols)
Description copied from interface: MappingDefaults
Fill in default information for the given column used to join a value to its related type. The column will be a clone of the target column, or have its name and Java type set in the case of a constant target.

Specified by:
populateForeignKeyColumn in interface MappingDefaults
name - base name for value, as decided by mapping
target - the target of this column in the join; may be another column or a constant value
inverse - whether this is an inverse foreign key
pos - the index of this column in the logical foreign key
cols - the number of columns in the logical foreign key

populateColumns

public void populateColumns(ValueMapping vm,
                            java.lang.String name,
                            Table table,
                            Column[] cols)
Description copied from interface: MappingDefaults
Fill in default information for the given value columns. The columns' name and Java type will already be populated with generic defaults that may be replaced.

Specified by:
populateColumns in interface MappingDefaults
name - base name for value, as decided by mapping

populateOrderColumns

public boolean populateOrderColumns(FieldMapping fm,
                                    Table table,
                                    Column[] cols)
Description copied from interface: MappingDefaults
Fill in default information for the given order columns. The columns' name and Java type will already be populated with generic defaults that may be replaced.

Specified by:
populateOrderColumns in interface MappingDefaults
Returns:
false if the given field should not have order columns by default; fill in default information even when returning false in case the user forces ordering

populateNullIndicatorColumns

public boolean populateNullIndicatorColumns(ValueMapping vm,
                                            java.lang.String name,
                                            Table table,
                                            Column[] cols)
Description copied from interface: MappingDefaults
Fill in default information for the given null indicator columns. The columns' name and Java type will already be populated with generic defaults that may be replaced.

Specified by:
populateNullIndicatorColumns in interface MappingDefaults
name - base name for value, as decided by mapping
Returns:
false if the given value should not have null indicator columns by default; fill in default information even when returning false in case the user forces an indicator

getJoinForeignKey

public ForeignKey getJoinForeignKey(ClassMapping cls,
                                    Table local,
                                    Table foreign)
Description copied from interface: MappingDefaults
Return a default foreign key for the join from this class' table to its superclass' table, or null for a logical foreign key only. Do not add columns to the key or add the key to the table; only fill in its information such as name, delete action, etc.

Specified by:
getJoinForeignKey in interface MappingDefaults

getJoinForeignKey

public ForeignKey getJoinForeignKey(FieldMapping fm,
                                    Table local,
                                    Table foreign)
Description copied from interface: MappingDefaults
Return a default foreign key for the join from this field's table to its defining class' table, or null for a logical foreign key only. Do not add columns to the key or add the key to the table; only fill in its information such as name, delete action, etc.

Specified by:
getJoinForeignKey in interface MappingDefaults

getForeignKey

public ForeignKey getForeignKey(ValueMapping vm,
                                java.lang.String name,
                                Table local,
                                Table foreign,
                                boolean inverse)
Description copied from interface: MappingDefaults
Return a default foreign key for the join from this value to its related type, or null for a logical foreign key only. Do not add columns to the key or add the key to the table; only fill in its information such as name, delete action, etc.

Specified by:
getForeignKey in interface MappingDefaults
name - base name for value, as decided by mapping
inverse - whether this is an inverse key

getJoinIndex

public Index getJoinIndex(FieldMapping fm,
                          Table table,
                          Column[] cols)
Description copied from interface: MappingDefaults
Return a default index for the join, or null if the join columns should not be indexed by default. Do not add columns to the index or add the index to the table; only fill in its information such as name, uniqueness, etc.

Specified by:
getJoinIndex in interface MappingDefaults

areAllPrimaryKeyColumns

protected boolean areAllPrimaryKeyColumns(Column[] cols)
Return whether all the given columns are primary key columns.


getIndexName

protected java.lang.String getIndexName(java.lang.String name,
                                        Table table,
                                        Column[] cols)
Generate an index name.


getIndex

public Index getIndex(ValueMapping vm,
                      java.lang.String name,
                      Table table,
                      Column[] cols)
Description copied from interface: MappingDefaults
Return a default index for the value, or null if the value columns should not be indexed by default. Do not add columns to the index or add the index to the table; only fill in its information such as name, uniqueness, etc.

Specified by:
getIndex in interface MappingDefaults
name - base name for value, as decided by mapping

getIndex

public Index getIndex(Version vers,
                      Table table,
                      Column[] cols)
Description copied from interface: MappingDefaults
Return a default index for the version, or null if the version columns should not be indexed by default. Do not add columns to the index or add the index to the table; only fill in its information such as name, uniqueness, etc.

Specified by:
getIndex in interface MappingDefaults

getIndex

public Index getIndex(Discriminator disc,
                      Table table,
                      Column[] cols)
Description copied from interface: MappingDefaults
Return a default index for the discriminator, or null if the discriminator columns should not be indexed by default. Do not add columns to the index or add the index to the table; only fill in its information such as name, uniqueness, etc.

Specified by:
getIndex in interface MappingDefaults

getJoinUnique

public Unique getJoinUnique(FieldMapping fm,
                            Table table,
                            Column[] cols)
Description copied from interface: MappingDefaults
Return a default constraint for the join, or null if the join columns should not be constrained by default. Do not add columns to the constraint or add the constraint to the table; only fill in its information such as name, deferrability, etc.

Specified by:
getJoinUnique in interface MappingDefaults

getUnique

public Unique getUnique(ValueMapping vm,
                        java.lang.String name,
                        Table table,
                        Column[] cols)
Description copied from interface: MappingDefaults
Return a default constraint for the value, or null if the value columns should not be constrained by default. Do not add columns to the constraint or add the constraint to the table; only fill in its information such as name, deferrability, etc.

Specified by:
getUnique in interface MappingDefaults
name - base name for value, as decided by mapping

getPrimaryKeyName

public java.lang.String getPrimaryKeyName(ClassMapping cm,
                                          Table table)
Description copied from interface: MappingDefaults
Return the name of the primary key for the table of the given class, or null for database default.

Specified by:
getPrimaryKeyName in interface MappingDefaults

installPrimaryKey

public void installPrimaryKey(FieldMapping fm,
                              Table table)
Description copied from interface: MappingDefaults
If desired, install a primary key on the given secondary table.

Specified by:
installPrimaryKey in interface MappingDefaults

setConfiguration

public void setConfiguration(org.apache.openjpa.lib.conf.Configuration conf)
Specified by:
setConfiguration in interface org.apache.openjpa.lib.conf.Configurable

startConfiguration

public void startConfiguration()
Specified by:
startConfiguration in interface org.apache.openjpa.lib.conf.Configurable

endConfiguration

public void endConfiguration()
Specified by:
endConfiguration in interface org.apache.openjpa.lib.conf.Configurable


Copyright © 2006 Apache Software Foundation. All Rights Reserved.