com.solarmetric.kodo.impl.jdbc.ormapping
Class NToManyMapMapping
java.lang.Object
|
+--com.solarmetric.kodo.impl.jdbc.ormapping.Mapping
|
+--com.solarmetric.kodo.impl.jdbc.ormapping.FieldMapping
|
+--com.solarmetric.kodo.impl.jdbc.ormapping.AbstractMapMapping
|
+--com.solarmetric.kodo.impl.jdbc.ormapping.NToManyMapMapping
- All Implemented Interfaces:
- Key, LoadSecondary, Relation, SecondaryTable, StoreSecondary
- public class NToManyMapMapping
- extends AbstractMapMapping
- implements Relation
Represents a Map of simple keys to First Class Object values.
|
Method Summary |
protected boolean |
canMap(FieldMetaData fmd,
ClassResolver resolver)
Return true if this mapping type can handle the given field,
false otherwise. |
Object |
getDataStoreValue(Object val,
PersistenceManagerImpl pm)
Translate the given field value to its datastore equivalent. |
Column[] |
getRelationPKColumns()
Return the primary key column(s) of the related object. |
Class |
getRelationType()
Return the type the mapping relates to. |
protected void |
insert(Insert insert,
Object key,
Object value,
StateManagerImpl sm,
Object[] pks,
int field)
|
protected void |
install(FieldMetaData fmd,
JDBCConfiguration conf,
ClassResolver resolver,
DBDictionary dict)
Setup this FieldMapping using the given metadata. |
void |
join(ObjectSelect sel)
Join this mapping to the given select statement. |
void |
joinKey(ObjectSelect sel)
Join the key of this mapping to the given select statement. |
void |
joinKeyRelation(Joins joins,
PersistenceManagerImpl pm)
Join this value's table to the table for the related first class object
key type, if any. |
void |
joinRelation(Joins joins,
PersistenceManagerImpl pm)
Join this value's table to the table for the related first class object
type, if any. |
void |
load(StateManagerImpl sm,
Object[] pks,
int field,
SQLExecutionManager sqlem)
Load the value of this mapping for the given instance. |
void |
setRelationPKColumns(Column[] val)
|
| Methods inherited from class com.solarmetric.kodo.impl.jdbc.ormapping.AbstractMapMapping |
appendIsEmpty, appendIsNotNull, appendIsNull, compareToNull, delete, getKeyColumn, getKeyColumns, getPKColumns, getRefColumns, getSecondaryTable, insert, join, joinKey, select, setKeyColumn, setPKColumns, setRefColumns, update |
| 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 |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NToManyMapMapping
public NToManyMapMapping()
getRelationType
public Class getRelationType()
- Description copied from interface:
Relation
- Return the type the mapping relates to.
- Specified by:
getRelationType in interface Relation
getRelationPKColumns
public Column[] getRelationPKColumns()
- Description copied from interface:
Relation
- Return the primary key column(s) of the related object.
- Specified by:
getRelationPKColumns in interface Relation
setRelationPKColumns
public void setRelationPKColumns(Column[] val)
join
public void join(ObjectSelect sel)
- Description copied from class:
FieldMapping
- Join this mapping to the given select statement. For basic mappings,
this no-op method implementation will suffice. Secondary table
mappings should override this method to do the proper join.
- Overrides:
join in class FieldMapping
joinKey
public void joinKey(ObjectSelect sel)
- Description copied from interface:
Key
- Join the key of this mapping to the given select statement.
load
public void load(StateManagerImpl sm,
Object[] pks,
int field,
SQLExecutionManager sqlem)
throws SQLException
- Description copied from interface:
LoadSecondary
- Load the value of this mapping for the given instance.
Relations to other persistent types are loaded
as PersistenceCapable instances.
- Following copied from interface:
com.solarmetric.kodo.impl.jdbc.ormapping.LoadSecondary
- Parameters:
stmnt - The caller is responsible for closing the statement.
insert
protected void insert(Insert insert,
Object key,
Object value,
StateManagerImpl sm,
Object[] pks,
int field)
- Overrides:
insert in class AbstractMapMapping
canMap
protected boolean canMap(FieldMetaData fmd,
ClassResolver resolver)
- Description copied from class:
FieldMapping
- Return true if this mapping type can handle the given field,
false otherwise. Note that this method cannot rely on the existance
of other Mappings, as it is used in bootstrapping.
- Overrides:
canMap in class AbstractMapMapping
install
protected void install(FieldMetaData fmd,
JDBCConfiguration conf,
ClassResolver resolver,
DBDictionary dict)
- Description copied from class:
FieldMapping
- Setup this FieldMapping using the given metadata. Note that this
method cannot rely on the existance of other Mappings, as it
it is used in bootstrapping. This base implementation installs
the proper extensions onto the metadata only; subclasses must override
to properly map the type.
- Overrides:
install in class AbstractMapMapping
getDataStoreValue
public Object getDataStoreValue(Object val,
PersistenceManagerImpl pm)
- Description copied from class:
FieldMapping
- Translate the given field value to its datastore equivalent. If the
mapping occupies multiple columns in the datastore, return an object
array, else return a single object. Simply returns the given object by
default.
- Overrides:
getDataStoreValue in class FieldMapping
joinRelation
public void joinRelation(Joins joins,
PersistenceManagerImpl pm)
- Description copied from class:
FieldMapping
- Join this value's table to the table for the related first class object
type, if any.
- Overrides:
joinRelation in class FieldMapping
joinKeyRelation
public void joinKeyRelation(Joins joins,
PersistenceManagerImpl pm)
- Description copied from class:
FieldMapping
- Join this value's table to the table for the related first class object
key type, if any.
- Overrides:
joinKeyRelation in class FieldMapping
Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.