|
SolarMetric Kodo JDO 3.3.5 generated on August 31 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kodo.jdbc.meta.Mappings
Mapping helper class.
Field Summary | |
static int |
DEFAULT
|
static int |
FALSE
|
static int |
FKOID_ALL
|
static int |
FKOID_FALSE
|
static int |
FKOID_TRUE
|
static int |
LOB
|
static int |
TRUE
|
static int |
UNIQUE
|
Constructor Summary | |
Mappings()
|
Method Summary | |
static void |
checkIndex(Mapping mapping,
String name,
int index,
Column[] idxCols,
int defaultIndexed)
Check the index-related extensions on the given meta data, and make sure they are consistent with the schema. |
static Column |
createColumn(Mapping mapping,
String name,
int jdbcType,
int size,
Table table)
Create a new column for the given metadata. |
static Table |
createTable(ClassMapping mapping,
Schema schema)
Create a new table for the given mapping. |
static ClassMapping[] |
getClassMappingDefaults()
Return the set of default mapping types. |
static String |
getDeleteActionConstant(int i,
boolean deferred)
Return the foreign key delete action name for the given action. |
static int |
getDeleteActionConstant(String str)
Return the foreign key delete action for the given name. |
static List |
getFieldMappingDefaults()
Return the default set of available field mappings. |
static ForeignKey |
getForeignKey(Mapping mapping,
MappingInfo info,
String attrPrefix,
Table table,
Table toTable)
Return a foreign key between the given tables, based on linking information in the given mapping info. |
static String |
getIndexedConstant(int i)
Return the index type name for the given constant: UNIQUE , TRUE , or FALSE . |
static int |
getIndexedConstant(String str)
Return the constant index type for the given name: UNIQUE , TRUE , or FALSE . |
static MappingInfoNotFoundException |
invalidMapping(String msg,
Mapping mapping,
Class forClass)
Return an invalid mapping exception. |
static MappingInfoNotFoundException |
invalidMapping(String msg,
Mapping mapping,
Class forClass,
Object[] params)
Return an invalid mapping exception. |
static boolean |
isDeleteActionDeferred(String action)
Return whether the given delete action constant represents a deferred foreign key. |
static int |
isForeignKeyObjectId(ClassMapping mapping,
ForeignKey fk)
Return whether the given foreign key to the given mapping can be used to construct object id values. |
static boolean |
isValue(int type)
Return true if the given type code represents a simple JDBC value. |
static void |
log(String msg,
Mapping mapping,
Class forClass)
Log a warning about bad mapping info and return false. |
static void |
log(String msg,
Mapping mapping,
Class forClass,
Object[] params)
Log a warning about bad mapping info and return false. |
static ClassMapping |
newClassMappingInstance(String type,
ClassMetaData meta)
Return the mapping for the given mapping type. |
static FieldMapping |
newFieldMappingInstance(String type,
FieldMetaData meta)
Return the mapping for the given mapping name. |
static void |
setForeignKey(MappingInfo info,
String attrPrefix,
ForeignKey fk)
Sets the attributes for linking with the given foreign key into the given mapping info. |
protected static void |
validateMappingInfoAttributes(Mapping mapping,
MappingInfo info)
Validate the specified mapping by checking its mapping information attributes against a set of pre-defined valid names. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT
public static final int TRUE
public static final int FALSE
public static final int UNIQUE
public static final int LOB
public static final int FKOID_ALL
public static final int FKOID_TRUE
public static final int FKOID_FALSE
Constructor Detail |
public Mappings()
Method Detail |
public static void log(String msg, Mapping mapping, Class forClass)
msg
- the localizer key for the message; the 'this' ptr
will be passed as a parameter to the messagepublic static void log(String msg, Mapping mapping, Class forClass, Object[] params)
msg
- the localizer key for the message; the 'this' ptr
will be passed as a parameter to the messageparams
- substitutions into the messagepublic static MappingInfoNotFoundException invalidMapping(String msg, Mapping mapping, Class forClass)
msg
- the localizer key for the message; the 'this' ptr
will be passed as a parameter to the messagepublic static MappingInfoNotFoundException invalidMapping(String msg, Mapping mapping, Class forClass, Object[] params)
msg
- the localizer key for the message; the 'this' ptr
will be passed as a parameter to the messageparams
- the object parameters to send to the messagepublic static Table createTable(ClassMapping mapping, Schema schema)
public static Column createColumn(Mapping mapping, String name, int jdbcType, int size, Table table)
public static ForeignKey getForeignKey(Mapping mapping, MappingInfo info, String attrPrefix, Table table, Table toTable)
public static void setForeignKey(MappingInfo info, String attrPrefix, ForeignKey fk)
attrPrefix
- the prefix to place on the 'column' and 'constant'
attributes used to record this foreign key, or null
for no prefixpublic static int isForeignKeyObjectId(ClassMapping mapping, ForeignKey fk)
FKOID_ALL
, FKOID_TRUE
, or FKOID_FALSE
public static void checkIndex(Mapping mapping, String name, int index, Column[] idxCols, int defaultIndexed)
defaultIndexed
is TRUE
or UNIQUE
and it
does not already exist. Mappings should use this method with the
appropriate defaultIndexed
setting when installing
themselves, and with a defaultIndexed
setting of
DEFAULT
when reading themselves from mapping info. This
ensures that mappings are created with the appropriate indexing, and
that indexes are created afterwords whenever a user changes the
mapping information to explicitly mark a field indexed, but that
indexes are not added to existing schemas that don't
want them.public static boolean isDeleteActionDeferred(String action)
public static int getDeleteActionConstant(String str)
public static String getDeleteActionConstant(int i, boolean deferred)
public static int getIndexedConstant(String str)
UNIQUE
, TRUE
, or FALSE
.public static String getIndexedConstant(int i)
UNIQUE
, TRUE
, or FALSE
.public static boolean isValue(int type)
public static FieldMapping newFieldMappingInstance(String type, FieldMetaData meta)
public static List getFieldMappingDefaults()
public static ClassMapping newClassMappingInstance(String type, ClassMetaData meta)
public static ClassMapping[] getClassMappingDefaults()
protected static void validateMappingInfoAttributes(Mapping mapping, MappingInfo info)
|
SolarMetric Kodo JDO 3.3.5 generated on August 31 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |