Package org.apache.openjpa.jdbc.meta
Class NoneMappingDefaults
- java.lang.Object
 - 
- org.apache.openjpa.jdbc.meta.NoneMappingDefaults
 
 
- 
- All Implemented Interfaces:
 MappingDefaults
public class NoneMappingDefaults extends Object implements MappingDefaults
No-op mapping defaults.- Author:
 - Abe White
 
 
- 
- 
Constructor Summary
Constructors Constructor Description NoneMappingDefaults() 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleandefaultMissingInfo()Whether to fill in missing mapping information at runtime with the default values supplied by this plugin.ObjectgetDiscriminatorValue(Discriminator disc, boolean adapt)Return the default discriminator value for the given instance.ForeignKeygetForeignKey(ValueMapping vm, String name, Table local, Table foreign, boolean inverse)Deprecated.ForeignKeygetForeignKey(ValueMapping vm, DBIdentifier 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.IndexgetIndex(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.IndexgetIndex(ValueMapping vm, 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.IndexgetIndex(ValueMapping vm, DBIdentifier name, Table table, Column[] cols)Return a default index for the value, or null if the value columns should not be indexed by default.IndexgetIndex(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.static NoneMappingDefaultsgetInstance()ForeignKeygetJoinForeignKey(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.ForeignKeygetJoinForeignKey(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.IndexgetJoinIndex(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.UniquegetJoinUnique(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.DBIdentifiergetPrimaryKeyIdentifier(ClassMapping cm, Table table)Return the name of the primary key for the table of the given class, or null for database default.StringgetPrimaryKeyName(ClassMapping cm, Table table)Return the name of the primary key for the table of the given class, or null for database default.ObjectgetStrategy(ClassMapping cls, boolean adapt)Default mapping strategy when there is no explicit strategy and no hierarchy strategy given.ObjectgetStrategy(Discriminator disc, boolean adapt)Default discriminator mapping strategy when there is no explicit strategy.ObjectgetStrategy(ValueMapping vm, Class<?> type, boolean adapt)Custom handler or strategy for the given field, or null if none has been registered.ObjectgetStrategy(Version vers, boolean adapt)Default version mapping strategy when there is no explicit strategy.DBIdentifiergetTableIdentifier(ClassMapping cls, Schema defaultSchema)Return the default table name for the given class.DBIdentifiergetTableIdentifier(FieldMapping fm, Schema defaultSchema)Return the default secondary table name for the given field.StringgetTableName(ClassMapping cls, Schema schema)Return the default table name for the given class.StringgetTableName(FieldMapping fm, Schema schema)Return the default secondary table name for the given field.UniquegetUnique(ValueMapping vm, 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.UniquegetUnique(ValueMapping vm, DBIdentifier name, Table table, Column[] cols)Return a default constraint for the value, or null if the value columns should not be constrained by default.voidinstallPrimaryKey(FieldMapping fm, Table table)If desired, install a primary key on the given secondary table.voidpopulateColumns(Discriminator disc, Table table, Column[] cols)Fill in default information for the given discriminator columns.voidpopulateColumns(ValueMapping vm, String name, Table table, Column[] cols)Deprecated.voidpopulateColumns(ValueMapping vm, DBIdentifier name, Table table, Column[] cols)Fill in default information for the given value columns.voidpopulateColumns(Version vers, Table table, Column[] cols)Fill in default information for the given version columns.voidpopulateDataStoreIdColumns(ClassMapping cls, Table table, Column[] cols)Fill in default information for the given datastore identity columns.voidpopulateForeignKeyColumn(ValueMapping vm, String name, Table local, Table foreign, Column col, Object target, boolean inverse, int pos, int cols)Deprecated.voidpopulateForeignKeyColumn(ValueMapping vm, DBIdentifier name, Table local, Table foreign, Column col, 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.voidpopulateJoinColumn(ClassMapping cm, Table local, Table foreign, Column col, Object target, int pos, int cols)Fill in default information for the given column used to join a class to its superclass table.voidpopulateJoinColumn(FieldMapping fm, Table local, Table foreign, Column col, Object target, int pos, int cols)Fill in default information for the given column used to join a field to its defining class' table.booleanpopulateNullIndicatorColumns(ValueMapping vm, String name, Table table, Column[] cols)Deprecated.booleanpopulateNullIndicatorColumns(ValueMapping vm, DBIdentifier name, Table table, Column[] cols)Fill in default information for the given null indicator columns.booleanpopulateOrderColumns(FieldMapping fm, Table table, Column[] cols)Fill in default information for the given order columns.booleanuseClassCriteria()The default for whether relations use the related object's expected class as part of the join criteria. 
 - 
 
- 
- 
Method Detail
- 
getInstance
public static NoneMappingDefaults getInstance()
 
- 
defaultMissingInfo
public boolean defaultMissingInfo()
Description copied from interface:MappingDefaultsWhether 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:
 defaultMissingInfoin interfaceMappingDefaults
 
- 
useClassCriteria
public boolean useClassCriteria()
Description copied from interface:MappingDefaultsThe default for whether relations use the related object's expected class as part of the join criteria.- Specified by:
 useClassCriteriain interfaceMappingDefaults
 
- 
getStrategy
public Object getStrategy(ClassMapping cls, boolean adapt)
Description copied from interface:MappingDefaultsDefault mapping strategy when there is no explicit strategy and no hierarchy strategy given.- Specified by:
 getStrategyin interfaceMappingDefaults- Parameters:
 cls- the class; will not be mapped, but superclass and rawMappingInfowill be availableadapt- whether we can adapt the mapping or schema- Returns:
 - the strategy alias or a strategy instance, or null
 
 
- 
getStrategy
public Object getStrategy(Version vers, boolean adapt)
Description copied from interface:MappingDefaultsDefault version mapping strategy when there is no explicit strategy.- Specified by:
 getStrategyin interfaceMappingDefaults- Parameters:
 vers- the version; will not be mapped, but rawMappingInfowill be availableadapt- whether we can adapt the mapping or schema- Returns:
 - the strategy alias or a strategy instance, or null
 
 
- 
getStrategy
public Object getStrategy(Discriminator disc, boolean adapt)
Description copied from interface:MappingDefaultsDefault discriminator mapping strategy when there is no explicit strategy.- Specified by:
 getStrategyin interfaceMappingDefaults- Parameters:
 disc- the discriminator; will not be mapped, but rawMappingInfowill be availableadapt- whether we can adapt the mapping or schema- Returns:
 - the strategy alias or a strategy instance, or null
 
 
- 
getStrategy
public Object getStrategy(ValueMapping vm, Class<?> type, boolean adapt)
Description copied from interface:MappingDefaultsCustom handler or strategy for the given field, or null if none has been registered.- Specified by:
 getStrategyin interfaceMappingDefaults- Parameters:
 vm- the value mapping; will not be mapped, but rawMappingInfowill be availabletype- the value typeadapt- whether we can adapt the mapping or schema- Returns:
 - the handler/strategy alias or instance, or null
 
 
- 
getDiscriminatorValue
public Object getDiscriminatorValue(Discriminator disc, boolean adapt)
Description copied from interface:MappingDefaultsReturn the default discriminator value for the given instance.- Specified by:
 getDiscriminatorValuein interfaceMappingDefaults
 
- 
getTableName
public String getTableName(ClassMapping cls, Schema schema)
Description copied from interface:MappingDefaultsReturn the default table name for the given class. This method is only called for classes mapped to their own table.- Specified by:
 getTableNamein interfaceMappingDefaults
 
- 
getTableName
public String getTableName(FieldMapping fm, Schema schema)
Description copied from interface:MappingDefaultsReturn the default secondary table name for the given field. This method is only called for fields whose strategy requires a secondary table.- Specified by:
 getTableNamein interfaceMappingDefaults
 
- 
populateDataStoreIdColumns
public void populateDataStoreIdColumns(ClassMapping cls, Table table, Column[] cols)
Description copied from interface:MappingDefaultsFill 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:
 populateDataStoreIdColumnsin interfaceMappingDefaults
 
- 
populateColumns
public void populateColumns(Version vers, Table table, Column[] cols)
Description copied from interface:MappingDefaultsFill 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:
 populateColumnsin interfaceMappingDefaults
 
- 
populateColumns
public void populateColumns(Discriminator disc, Table table, Column[] cols)
Description copied from interface:MappingDefaultsFill 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:
 populateColumnsin interfaceMappingDefaults
 
- 
populateJoinColumn
public void populateJoinColumn(ClassMapping cm, Table local, Table foreign, Column col, Object target, int pos, int cols)
Description copied from interface:MappingDefaultsFill 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:
 populateJoinColumnin interfaceMappingDefaultstarget- the target of this column in the join; may be another column or a constant valuepos- the index of this column in the logical foreign keycols- the number of columns in the logical foreign key
 
- 
populateJoinColumn
public void populateJoinColumn(FieldMapping fm, Table local, Table foreign, Column col, Object target, int pos, int cols)
Description copied from interface:MappingDefaultsFill 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:
 populateJoinColumnin interfaceMappingDefaultstarget- the target of this column in the join; may be another column or a constant valuepos- the index of this column in the logical foreign keycols- the number of columns in the logical foreign key
 
- 
populateForeignKeyColumn
@Deprecated public void populateForeignKeyColumn(ValueMapping vm, String name, Table local, Table foreign, Column col, Object target, boolean inverse, int pos, int cols)
Deprecated.Description copied from interface:MappingDefaultsFill 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:
 populateForeignKeyColumnin interfaceMappingDefaultsname- base name for value, as decided by mappingtarget- the target of this column in the join; may be another column or a constant valueinverse- whether this is an inverse foreign keypos- the index of this column in the logical foreign keycols- the number of columns in the logical foreign key
 
- 
populateColumns
@Deprecated public void populateColumns(ValueMapping vm, String name, Table table, Column[] cols)
Deprecated.Description copied from interface:MappingDefaultsFill 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:
 populateColumnsin interfaceMappingDefaultsname- base name for value, as decided by mapping
 
- 
populateOrderColumns
public boolean populateOrderColumns(FieldMapping fm, Table table, Column[] cols)
Description copied from interface:MappingDefaultsFill 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:
 populateOrderColumnsin interfaceMappingDefaults- 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
@Deprecated public boolean populateNullIndicatorColumns(ValueMapping vm, String name, Table table, Column[] cols)
Deprecated.Description copied from interface:MappingDefaultsFill 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:
 populateNullIndicatorColumnsin interfaceMappingDefaultsname- 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:MappingDefaultsReturn 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:
 getJoinForeignKeyin interfaceMappingDefaults
 
- 
getJoinForeignKey
public ForeignKey getJoinForeignKey(FieldMapping fm, Table local, Table foreign)
Description copied from interface:MappingDefaultsReturn 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:
 getJoinForeignKeyin interfaceMappingDefaults
 
- 
getForeignKey
@Deprecated public ForeignKey getForeignKey(ValueMapping vm, String name, Table local, Table foreign, boolean inverse)
Deprecated.Description copied from interface:MappingDefaultsReturn 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:
 getForeignKeyin interfaceMappingDefaultsname- base name for value, as decided by mappinginverse- whether this is an inverse key
 
- 
getJoinIndex
public Index getJoinIndex(FieldMapping fm, Table table, Column[] cols)
Description copied from interface:MappingDefaultsReturn 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:
 getJoinIndexin interfaceMappingDefaults
 
- 
getIndex
public Index getIndex(ValueMapping vm, String name, Table table, Column[] cols)
Description copied from interface:MappingDefaultsReturn 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:
 getIndexin interfaceMappingDefaultsname- base name for value, as decided by mapping
 
- 
getIndex
public Index getIndex(Version vers, Table table, Column[] cols)
Description copied from interface:MappingDefaultsReturn 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:
 getIndexin interfaceMappingDefaults
 
- 
getIndex
public Index getIndex(Discriminator disc, Table table, Column[] cols)
Description copied from interface:MappingDefaultsReturn 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:
 getIndexin interfaceMappingDefaults
 
- 
getJoinUnique
public Unique getJoinUnique(FieldMapping fm, Table table, Column[] cols)
Description copied from interface:MappingDefaultsReturn 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:
 getJoinUniquein interfaceMappingDefaults
 
- 
getUnique
public Unique getUnique(ValueMapping vm, String name, Table table, Column[] cols)
Description copied from interface:MappingDefaultsReturn 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:
 getUniquein interfaceMappingDefaultsname- base name for value, as decided by mapping
 
- 
getPrimaryKeyName
public String getPrimaryKeyName(ClassMapping cm, Table table)
Description copied from interface:MappingDefaultsReturn the name of the primary key for the table of the given class, or null for database default.- Specified by:
 getPrimaryKeyNamein interfaceMappingDefaults
 
- 
installPrimaryKey
public void installPrimaryKey(FieldMapping fm, Table table)
Description copied from interface:MappingDefaultsIf desired, install a primary key on the given secondary table.- Specified by:
 installPrimaryKeyin interfaceMappingDefaults
 
- 
getForeignKey
public ForeignKey getForeignKey(ValueMapping vm, DBIdentifier name, Table local, Table foreign, boolean inverse)
Description copied from interface:MappingDefaultsReturn 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:
 getForeignKeyin interfaceMappingDefaultsname- base name for value, as decided by mappinginverse- whether this is an inverse key
 
- 
getIndex
public Index getIndex(ValueMapping vm, DBIdentifier name, Table table, Column[] cols)
Description copied from interface:MappingDefaultsReturn 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:
 getIndexin interfaceMappingDefaultsname- base name for value, as decided by mapping
 
- 
getUnique
public Unique getUnique(ValueMapping vm, DBIdentifier name, Table table, Column[] cols)
Description copied from interface:MappingDefaultsReturn 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:
 getUniquein interfaceMappingDefaultsname- base name for value, as decided by mapping
 
- 
populateColumns
public void populateColumns(ValueMapping vm, DBIdentifier name, Table table, Column[] cols)
Description copied from interface:MappingDefaultsFill 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:
 populateColumnsin interfaceMappingDefaultsname- base name for value, as decided by mapping
 
- 
populateForeignKeyColumn
public void populateForeignKeyColumn(ValueMapping vm, DBIdentifier name, Table local, Table foreign, Column col, Object target, boolean inverse, int pos, int cols)
Description copied from interface:MappingDefaultsFill 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:
 populateForeignKeyColumnin interfaceMappingDefaultsname- base name for value, as decided by mappingtarget- the target of this column in the join; may be another column or a constant valueinverse- whether this is an inverse foreign keypos- the index of this column in the logical foreign keycols- the number of columns in the logical foreign key
 
- 
populateNullIndicatorColumns
public boolean populateNullIndicatorColumns(ValueMapping vm, DBIdentifier name, Table table, Column[] cols)
Description copied from interface:MappingDefaultsFill 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:
 populateNullIndicatorColumnsin interfaceMappingDefaultsname- 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
 
 
- 
getTableIdentifier
public DBIdentifier getTableIdentifier(ClassMapping cls, Schema defaultSchema)
Description copied from interface:MappingDefaultsReturn the default table name for the given class. This method is only called for classes mapped to their own table.- Specified by:
 getTableIdentifierin interfaceMappingDefaults
 
- 
getTableIdentifier
public DBIdentifier getTableIdentifier(FieldMapping fm, Schema defaultSchema)
Description copied from interface:MappingDefaultsReturn the default secondary table name for the given field. This method is only called for fields whose strategy requires a secondary table.- Specified by:
 getTableIdentifierin interfaceMappingDefaults
 
- 
getPrimaryKeyIdentifier
public DBIdentifier getPrimaryKeyIdentifier(ClassMapping cm, Table table)
Description copied from interface:MappingDefaultsReturn the name of the primary key for the table of the given class, or null for database default.- Specified by:
 getPrimaryKeyIdentifierin interfaceMappingDefaults
 
 - 
 
 -