Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 292146 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java (-4 / +3 lines)
Lines 103-109 Link Here
103
103
104
    // add fields for keys (cdo_id, version, feature_id)
104
    // add fields for keys (cdo_id, version, feature_id)
105
    FieldInfo[] fields = getKeyFields();
105
    FieldInfo[] fields = getKeyFields();
106
    IDBField[] dbFields = new IDBField[fields.length];
106
    IDBField[] dbFields = new IDBField[fields.length + 1];
107
107
108
    for (int i = 0; i < fields.length; i++)
108
    for (int i = 0; i < fields.length; i++)
109
    {
109
    {
Lines 111-125 Link Here
111
    }
111
    }
112
112
113
    // add field for list index
113
    // add field for list index
114
    IDBField idxField = table.addField(CDODBSchema.LIST_IDX, DBType.INTEGER);
114
    dbFields[dbFields.length - 1] = table.addField(CDODBSchema.LIST_IDX, DBType.INTEGER);
115
115
116
    // add field for value
116
    // add field for value
117
    typeMapping = mappingStrategy.createValueMapping(feature);
117
    typeMapping = mappingStrategy.createValueMapping(feature);
118
    typeMapping.createDBField(table, CDODBSchema.LIST_VALUE);
118
    typeMapping.createDBField(table, CDODBSchema.LIST_VALUE);
119
119
120
    // add table indexes
120
    // add table indexes
121
    table.addIndex(Type.NON_UNIQUE, dbFields);
121
    table.addIndex(Type.UNIQUE, dbFields);
122
    table.addIndex(Type.NON_UNIQUE, idxField);
123
  }
122
  }
124
123
125
  protected abstract FieldInfo[] getKeyFields();
124
  protected abstract FieldInfo[] getKeyFields();
(-)src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java (-1 / +2 lines)
Lines 86-92 Link Here
86
    table = getMappingStrategy().getStore().getDBSchema().addTable(name);
86
    table = getMappingStrategy().getStore().getDBSchema().addTable(name);
87
87
88
    IDBField idField = table.addField(CDODBSchema.ATTRIBUTES_ID, DBType.BIGINT, true);
88
    IDBField idField = table.addField(CDODBSchema.ATTRIBUTES_ID, DBType.BIGINT, true);
89
    table.addField(CDODBSchema.ATTRIBUTES_VERSION, DBType.INTEGER, true);
89
    IDBField versionField = table.addField(CDODBSchema.ATTRIBUTES_VERSION, DBType.INTEGER, true);
90
    table.addField(CDODBSchema.ATTRIBUTES_CLASS, DBType.BIGINT, true);
90
    table.addField(CDODBSchema.ATTRIBUTES_CLASS, DBType.BIGINT, true);
91
    table.addField(CDODBSchema.ATTRIBUTES_CREATED, DBType.BIGINT, true);
91
    table.addField(CDODBSchema.ATTRIBUTES_CREATED, DBType.BIGINT, true);
92
    IDBField revisedField = table.addField(CDODBSchema.ATTRIBUTES_REVISED, DBType.BIGINT, true);
92
    IDBField revisedField = table.addField(CDODBSchema.ATTRIBUTES_REVISED, DBType.BIGINT, true);
Lines 94-99 Link Here
94
    table.addField(CDODBSchema.ATTRIBUTES_CONTAINER, DBType.BIGINT, true);
94
    table.addField(CDODBSchema.ATTRIBUTES_CONTAINER, DBType.BIGINT, true);
95
    table.addField(CDODBSchema.ATTRIBUTES_FEATURE, DBType.INTEGER, true);
95
    table.addField(CDODBSchema.ATTRIBUTES_FEATURE, DBType.INTEGER, true);
96
96
97
    table.addIndex(IDBIndex.Type.UNIQUE, idField, versionField);
97
    table.addIndex(IDBIndex.Type.NON_UNIQUE, idField, revisedField);
98
    table.addIndex(IDBIndex.Type.NON_UNIQUE, idField, revisedField);
98
  }
99
  }
99
100

Return to bug 292146