diff options
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractFeatureMapTableMapping.java')
-rw-r--r-- | plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractFeatureMapTableMapping.java | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractFeatureMapTableMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractFeatureMapTableMapping.java index af8b51a34a..ea4b9abd89 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractFeatureMapTableMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractFeatureMapTableMapping.java @@ -121,6 +121,9 @@ public abstract class AbstractFeatureMapTableMapping extends BasicAbstractListTa private void initTable() { IDBStore store = getMappingStrategy().getStore(); + DBType idType = store.getIDHandler().getDBType(); + int idLength = store.getIDColumnLength(); + String tableName = getMappingStrategy().getTableName(getContainingClass(), getFeature()); table = store.getDBSchema().addTable(tableName); @@ -130,14 +133,14 @@ public abstract class AbstractFeatureMapTableMapping extends BasicAbstractListTa for (int i = 0; i < fields.length; i++) { - dbFields[i] = table.addField(fields[i].getName(), fields[i].getDbType()); + dbFields[i] = table.addField(fields[i].getName(), fields[i].getDbType(), fields[i].getPrecision()); } // add field for list index IDBField idxField = table.addField(CDODBSchema.FEATUREMAP_IDX, DBType.INTEGER); // add field for FeatureMap tag (MetaID for Feature in CDO registry) - IDBField tagField = table.addField(CDODBSchema.FEATUREMAP_TAG, store.getIDHandler().getDBType()); + IDBField tagField = table.addField(CDODBSchema.FEATUREMAP_TAG, idType, idLength); tagMap = new HashMap<CDOID, String>(); typeMappings = new HashMap<CDOID, ITypeMapping>(); @@ -550,34 +553,6 @@ public abstract class AbstractFeatureMapTableMapping extends BasicAbstractListTa return metaDataManager.getMetaID(feature, timeStamp); } - /** - * Used by subclasses to indicate which fields should be in the table. I.e. just a pair of name and DBType ... - * - * @author Stefan Winkler - */ - protected static class FieldInfo - { - private String name; - - private DBType dbType; - - public FieldInfo(String name, DBType dbType) - { - this.name = name; - this.dbType = dbType; - } - - public String getName() - { - return name; - } - - public DBType getDbType() - { - return dbType; - } - } - public final boolean queryXRefs(IDBStoreAccessor accessor, String mainTableName, String mainTableWhere, QueryXRefsContext context, String idString) { |