|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IMappingStrategy
The mapping strategy acts as a connection between the DBStore and the database management (and OR-mapping) classes.
The DBStore uses methods of this interface to create and lookup mappings (or mappers, as they could also be
named as such) and to get properties and informations about the mappings used. The mapping classes (e.g., instances
of IClassMapping and IListMapping) also use this class as a central point of information and as a resource of common
functionalities.
| Field Summary | |
|---|---|
static java.lang.String |
PROP_FORCE_NAMES_WITH_ID
Name of the boolean property that configures whether table names and column names are always suffixed with the internal DBID or only in cases where generated names violate the naming constraints of the underlying backend. |
static java.lang.String |
PROP_MAX_FIELD_NAME_LENGTH
Name of the integer property that configures the maximum length for column names. |
static java.lang.String |
PROP_MAX_TABLE_NAME_LENGTH
Name of the integer property that configures the maximum length for table names. |
static java.lang.String |
PROP_QUALIFIED_NAMES
Name of the boolean property that configures whether the table names are made of simple class names or of qualified class names. |
static java.lang.String |
PROP_TABLE_NAME_PREFIX
Name of the String property that specifies a common prefix for table names. |
| Method Summary | |
|---|---|
IListMapping |
createListMapping(org.eclipse.emf.ecore.EClass containingClass,
org.eclipse.emf.ecore.EStructuralFeature feature)
Factory for value mappings of multi-valued-attributes. |
void |
createMapping(java.sql.Connection connection,
InternalCDOPackageUnit[] packageUnits,
org.eclipse.net4j.util.om.monitor.OMMonitor monitor)
Create and initialize the mapping infrastructure for the given packages. |
ITypeMapping |
createValueMapping(org.eclipse.emf.ecore.EStructuralFeature feature)
Factory for value mappings of single-valued attributes. |
IClassMapping |
getClassMapping(org.eclipse.emf.ecore.EClass eClass)
Look up an existing class mapping for the given class. |
java.lang.String |
getFieldName(org.eclipse.emf.ecore.EStructuralFeature feature)
Create a suitable column name which can be used to map the given element. |
IDBStore |
getStore()
|
java.lang.String |
getTableName(org.eclipse.emf.ecore.EClass containingClass,
org.eclipse.emf.ecore.EStructuralFeature feature)
Create a suitable table name which can be used to map the given element. |
java.lang.String |
getTableName(org.eclipse.emf.ecore.ENamedElement element)
Create a suitable table name which can be used to map the given element. |
boolean |
hasAuditSupport()
Query if this mapping supports audits. |
boolean |
hasDeltaSupport()
Query if this mapping supports revision deltas. |
void |
queryResources(IDBStoreAccessor dbStoreAccessor,
IStoreAccessor.QueryResourcesContext context)
Execute a resource query. |
org.eclipse.net4j.util.collection.CloseableIterator<CDOID> |
readObjectIDs(IDBStoreAccessor dbStoreAccessor)
Get an iterator over all instances of objects in the store. |
CDOClassifierRef |
readObjectType(IDBStoreAccessor dbStoreAccessor,
CDOID id)
Read the type (i.e. class) of the object referred to by a given ID. |
long |
repairAfterCrash(org.eclipse.net4j.db.IDBAdapter dbAdapter,
java.sql.Connection connection)
Return the maximum object id used in the store. |
void |
setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Set configuration properties for this mapping strategy. |
void |
setStore(IDBStore dbStore)
Set the store to which this MappingStrategy instance belongs. |
| Field Detail |
|---|
static final java.lang.String PROP_MAX_TABLE_NAME_LENGTH
db adapter to be used.
static final java.lang.String PROP_MAX_FIELD_NAME_LENGTH
db adapter to be used.
static final java.lang.String PROP_TABLE_NAME_PREFIX
static final java.lang.String PROP_QUALIFIED_NAMES
static final java.lang.String PROP_FORCE_NAMES_WITH_ID
| Method Detail |
|---|
IDBStore getStore()
void setStore(IDBStore dbStore)
DBStore, and
only once to initialize the connection between DBStore and mapping strategy.
dbStore - the DBStore instance to which this MappingStrategy instance belongs.ITypeMapping createValueMapping(org.eclipse.emf.ecore.EStructuralFeature feature)
feature - the feature for which a mapping should be created. It must hold feature.isMany() == false.
IListMapping createListMapping(org.eclipse.emf.ecore.EClass containingClass,
org.eclipse.emf.ecore.EStructuralFeature feature)
containingClass - the class containing the feature.feature - the feature for which a mapping should be created. It must hold feature.isMany() == true.
java.lang.String getTableName(org.eclipse.emf.ecore.ENamedElement element)
element - the element for which the name should be created. It must hold:
element instanceof EClass || element instanceof EPackage.
java.lang.String getTableName(org.eclipse.emf.ecore.EClass containingClass,
org.eclipse.emf.ecore.EStructuralFeature feature)
containingClass - the class containeng the feature.feature - the feature for which the table name should be created.
java.lang.String getFieldName(org.eclipse.emf.ecore.EStructuralFeature feature)
feature - the feature for which the column name should be created.
void createMapping(java.sql.Connection connection,
InternalCDOPackageUnit[] packageUnits,
org.eclipse.net4j.util.om.monitor.OMMonitor monitor)
connection - the connection to use.packageUnits - the packages whose elements should be mapped.monitor - the monitor to report progress.IClassMapping getClassMapping(org.eclipse.emf.ecore.EClass eClass)
createMapping(Connection, InternalCDOPackageUnit[], OMMonitor) on its
containing package.
eClass - the class to look up.
boolean hasDeltaSupport()
true, it is guaranteed that all class mappings returned by
getClassMapping(EClass) implement IClassMappingDeltaSupport.
true if revision deltas are supported, false else.boolean hasAuditSupport()
true, it is guaranteed that all class mappings returned by
getClassMapping(EClass) implement IClassMappingAuditSupport.
true if audits are supported, false else.
void queryResources(IDBStoreAccessor dbStoreAccessor,
IStoreAccessor.QueryResourcesContext context)
dbStoreAccessor - the accessor to use.context - the context from which the query parameters are read and to which the result is written.
CDOClassifierRef readObjectType(IDBStoreAccessor dbStoreAccessor,
CDOID id)
dbStoreAccessor - the accessor to use to look up the type.id - the ID of the object for which the type is to be determined.
org.eclipse.net4j.util.collection.CloseableIterator<CDOID> readObjectIDs(IDBStoreAccessor dbStoreAccessor)
dbStoreAccessor - the accessor to use.
long repairAfterCrash(org.eclipse.net4j.db.IDBAdapter dbAdapter,
java.sql.Connection connection)
dbAdapter - the dbAdapter to use to access the databaseconnection - the connection to use to access the database
void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
properties - the configuration properties to set.
|
Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||