|
SolarMetric Kodo JDO 2.5.8 generated on January 11 2004 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.solarmetric.kodo.impl.jdbc.ormapping.Mapping | +--com.solarmetric.kodo.impl.jdbc.ormapping.FieldMapping
A mapping between a field of a java class and its relational database representation.
Field Summary | |
static String |
COL_INDEX
Metadata extension key used to mark fields for indexing. |
static String |
COL_LENGTH
Metadata extension key used to specify the maximum length of a field. |
static String |
DATA_COL
Metadata extension key used to mark the name of the data column for this field. |
protected static Column[] |
EMPTY_COLUMNS
|
Fields inherited from class com.solarmetric.kodo.impl.jdbc.ormapping.Mapping |
_loc, _log, CUSTOM_MAPPING, dict, MAPPING, TABLE |
Constructor Summary | |
FieldMapping()
|
Method Summary | |
(package private) static Column |
addColumn(FieldMetaData fmd,
DBDictionary dict,
Table table,
String extName,
String defName,
String extLen,
String extIndex,
int type,
boolean key)
Utility method to add a column to the given table. |
(package private) static Column[] |
addPKColumns(ClassMetaData meta,
FieldMetaData fmd,
JDBCConfiguration conf,
Table table,
String extName,
String defName,
ClassResolver resolver,
DBDictionary dict)
Utility method to create columns corresponding to the primary key values of the given metadata. |
abstract void |
appendIsEmpty(QuerySQLBuffer sql,
Joins joins)
Create a where clause to the given statement asking if this value is empty. |
abstract void |
appendIsNotNull(QuerySQLBuffer sql,
Joins joins)
Add a where clause to the given statement asking if this value is not null. |
abstract void |
appendIsNull(QuerySQLBuffer sql,
Joins joins)
Add a where clause to the given statement asking if this value is null. |
(package private) abstract boolean |
canMap(FieldMetaData fmd,
ClassResolver resolver)
Return true if this mapping type can handle the given field, false otherwise. |
void |
compareToNull(ObjectSelect sel,
boolean isNull)
Compare this column to null. |
Column[] |
getDataColumns()
Return the primary data column(s) for this mapping. |
Object |
getDataStoreValue(Object val,
PersistenceManagerImpl pm)
Translate the given field value to its datastore equivalent. |
static FieldMapping |
getInstance(FieldMetaData fmd)
Return the FieldMapping for the given FieldMetaData, creating it if necessary. |
static FieldMapping |
getInstance(FieldMetaData fmd,
boolean required)
|
abstract Column[] |
getKeyColumns()
Return the key columns of the mapping. |
Object |
getKeyDataStoreValue(Object val,
PersistenceManagerImpl pm)
Translate the given key value to its datastore equivalent. |
FieldMetaData |
getMetaData()
Return the metadata for the primary data column. |
(package private) void |
install(FieldMetaData fmd,
JDBCConfiguration conf,
ClassResolver resolver,
DBDictionary dict)
Setup this FieldMapping using the given metadata. |
abstract void |
join(Joins joins,
PersistenceManagerImpl pm)
Join this value to the class table. |
void |
join(ObjectSelect select)
Join this mapping to the given select statement. |
abstract void |
joinKey(Joins joins,
PersistenceManagerImpl pm)
Join the key value to the class table. |
abstract void |
joinKeyRelation(Joins joins,
PersistenceManagerImpl pm)
Join this value's table to the table for the related first class object key type, if any. |
abstract void |
joinRelation(Joins joins,
PersistenceManagerImpl pm)
Join this value's table to the table for the related first class object type, if any. |
abstract void |
select(QuerySelect sel)
Select this mapping. |
void |
setDataColumns(Column[] data)
Set the primary data column(s) for this mapping. |
Methods inherited from class com.solarmetric.kodo.impl.jdbc.ormapping.Mapping |
checkExtension, createMapping, createMapping, createMappings, createMappings, getClassName, getConfiguration, getDictionary, getFieldMapping, getInstance, getTable, install |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final String DATA_COL
public static final String COL_INDEX
public static final String COL_LENGTH
protected static final Column[] EMPTY_COLUMNS
Constructor Detail |
public FieldMapping()
Method Detail |
public static FieldMapping getInstance(FieldMetaData fmd)
public static FieldMapping getInstance(FieldMetaData fmd, boolean required)
public Column[] getDataColumns()
public void setDataColumns(Column[] data)
public FieldMetaData getMetaData()
public void join(ObjectSelect select)
public void compareToNull(ObjectSelect sel, boolean isNull)
abstract boolean canMap(FieldMetaData fmd, ClassResolver resolver)
void install(FieldMetaData fmd, JDBCConfiguration conf, ClassResolver resolver, DBDictionary dict)
static Column[] addPKColumns(ClassMetaData meta, FieldMetaData fmd, JDBCConfiguration conf, Table table, String extName, String defName, ClassResolver resolver, DBDictionary dict)
meta
- the metadata whose pk columns to addfmd
- the field the mapping is being made fordict
- the dictionary of the database in usetable
- the table to add toextName
- the metadata etension to check for column names with;
if app identity the pk field name will be prependeddefName
- the default column name; if app identity the pk field
name will be prependedresolver
- the resolver to use for class name resolution.static Column addColumn(FieldMetaData fmd, DBDictionary dict, Table table, String extName, String defName, String extLen, String extIndex, int type, boolean key)
fmd
- the metadata for the column mappingdict
- the DBDictionary for the database in usetable
- the table to add the column toextName
- the metadata extension to check for the column namedefName
- the default name if no extension is presentextLen
- the metadata extension to check for the column lenextIndex
- the metadata extension to check for an index nametype
- the SQLType of the column or, if UNKNOWN, this
method will form the type from the fmd type and
column lengthkey
- if the mapping is for a map keypublic Object getDataStoreValue(Object val, PersistenceManagerImpl pm)
public Object getKeyDataStoreValue(Object val, PersistenceManagerImpl pm)
public abstract void select(QuerySelect sel)
public abstract Column[] getKeyColumns()
public abstract void appendIsEmpty(QuerySQLBuffer sql, Joins joins)
public abstract void appendIsNull(QuerySQLBuffer sql, Joins joins)
public abstract void appendIsNotNull(QuerySQLBuffer sql, Joins joins)
public abstract void join(Joins joins, PersistenceManagerImpl pm)
public abstract void joinKey(Joins joins, PersistenceManagerImpl pm)
public abstract void joinRelation(Joins joins, PersistenceManagerImpl pm)
public abstract void joinKeyRelation(Joins joins, PersistenceManagerImpl pm)
|
SolarMetric Kodo JDO 2.5.8 generated on January 11 2004 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |