This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
View | Details | Raw Unified | Return to bug 266912 | Differences between
and this patch

Collapse All | Expand All

(-)foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/descriptors/ObjectBuilder.java (+2 lines)
Lines 2469-2475 Link Here
2469
                if(this.descriptor.isDescriptorTypeAggregate()) {
2469
                if(this.descriptor.isDescriptorTypeAggregate()) {
2470
                    this.mayHaveNullInPrimaryKey = true;
2470
                    this.mayHaveNullInPrimaryKey = true;
2471
                } else {
2471
                } else {
2472
                    if(!primaryKeyField.getName().equals("__PK_METAMODEL_RESERVED_IN_MEM_ONLY_FIELD_NAME")) { // TODO: remove JPA dependency
2472
                    throw DescriptorException.noMappingForPrimaryKey(primaryKeyField, this.descriptor);
2473
                    throw DescriptorException.noMappingForPrimaryKey(primaryKeyField, this.descriptor);
2474
                    }
2473
                }
2475
                }
2474
            }
2476
            }
2475
2477
(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/classes/ClassAccessor.java (+4 lines)
Lines 1055-1058 Link Here
1055
    public boolean usesPropertyAccess() {
1055
    public boolean usesPropertyAccess() {
1056
        return getAccessType().equals(MetadataConstants.PROPERTY);
1056
        return getAccessType().equals(MetadataConstants.PROPERTY);
1057
    }
1057
    }
1058
    
1059
    protected boolean hasMappedSuperclasses() {
1060
        return false;
1061
    }
1058
}
1062
}
(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/classes/EmbeddableAccessor.java (-2 / +17 lines)
Lines 145-150 Link Here
145
     * INTERNAL:
145
     * INTERNAL:
146
     * This method processes an embeddable class, if we have not processed it 
146
     * This method processes an embeddable class, if we have not processed it 
147
     * yet. Be careful while changing the order of processing.
147
     * yet. Be careful while changing the order of processing.
148
     * <p>
149
     * MappedSuperclass descriptors have relaxed constraints.
148
     */
150
     */
149
    public void process(MetadataDescriptor owningDescriptor) {
151
    public void process(MetadataDescriptor owningDescriptor) {
150
        if (isProcessed()) {
152
        if (isProcessed()) {
Lines 152-158 Link Here
152
            // that it is not used in entities with conflicting access type
154
            // that it is not used in entities with conflicting access type
153
            // when the embeddable doesn't have its own explicit setting. The
155
            // when the embeddable doesn't have its own explicit setting. The
154
            // biggest mistake that could occur otherwise is that FIELD
156
            // biggest mistake that could occur otherwise is that FIELD
155
            // processing 'could' yield a different mapping set then PROPERTY
157
            // processing 'could' yield a different mapping set than PROPERTY
156
            // processing would. Do we really care? If both access types
158
            // processing would. Do we really care? If both access types
157
            // yielded the same mappings then the only difference would be
159
            // yielded the same mappings then the only difference would be
158
            // how they are accessed and well ... does it really matter at this
160
            // how they are accessed and well ... does it really matter at this
Lines 170-176 Link Here
170
            if (! hasAccess()) {
172
            if (! hasAccess()) {
171
                // We inherited our access from our owning entity.
173
                // We inherited our access from our owning entity.
172
                if (! getDescriptor().getDefaultAccess().equals(owningDescriptor.getDefaultAccess())) {
174
                if (! getDescriptor().getDefaultAccess().equals(owningDescriptor.getDefaultAccess())) {
173
                    throw ValidationException.conflictingAccessTypeForEmbeddable(getJavaClass(), usesPropertyAccess(), owningDescriptor.getJavaClass(), owningDescriptor.getClassAccessor().usesPropertyAccess());
175
                    // check that the accessor does not inherit from a MappedSuperclass
176
                    // TODO: 20090623 this implementation is to be optionally removed in production - testing pending
177
                    if(!getDescriptor().getClassAccessor().isMappedSuperclass()) {
178
                        if(!owningDescriptor.getClassAccessor().isMappedSuperclass()) {
179
                            if(!owningDescriptor.getClassAccessor().hasMappedSuperclasses()) { // relax constraint for MappedSuperclasses                                                
180
                                throw ValidationException.conflictingAccessTypeForEmbeddable(getJavaClass(), usesPropertyAccess(), owningDescriptor.getJavaClass(), owningDescriptor.getClassAccessor().usesPropertyAccess());
181
                            }
182
                        }
183
                    }
174
                }
184
                }
175
            }
185
            }
176
            
186
            
Lines 218-221 Link Here
218
            getDescriptor().setIgnoreDefaultMappings(excludeDefaultMappings());
228
            getDescriptor().setIgnoreDefaultMappings(excludeDefaultMappings());
219
        } 
229
        } 
220
    }
230
    }
231
232
    @Override
233
    protected boolean hasMappedSuperclasses() {
234
        return false;
235
    }
221
}
236
}
(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/classes/EntityAccessor.java (-8 / +29 lines)
Lines 39-44 Link Here
39
 *       - 266912: JPA 2.0 Metamodel API (part of Criteria API)
39
 *       - 266912: JPA 2.0 Metamodel API (part of Criteria API)
40
 *     06/16/2009-2.0 Guy Pelletier 
40
 *     06/16/2009-2.0 Guy Pelletier 
41
 *       - 277039: JPA 2.0 Cache Usage Settings 
41
 *       - 277039: JPA 2.0 Cache Usage Settings 
42
 *     06/10/2009-2.0 Michael O'Brien 
43
 *       - 266912: change MappedSuperclass handlers to pre process accessors
44
 *          processAccessType() is now public and is overridden in the superclass 
42
 ******************************************************************************/  
45
 ******************************************************************************/  
43
package org.eclipse.persistence.internal.jpa.metadata.accessors.classes;
46
package org.eclipse.persistence.internal.jpa.metadata.accessors.classes;
44
47
Lines 158-164 Link Here
158
            DatabaseField pkField = primaryKeyJoinColumn.getPrimaryKeyField();
161
            DatabaseField pkField = primaryKeyJoinColumn.getPrimaryKeyField();
159
            pkField.setName(getName(pkField, defaultPKFieldName, PK_CTX));
162
            pkField.setName(getName(pkField, defaultPKFieldName, PK_CTX));
160
            pkField.setTable(sourceTable);
163
            pkField.setTable(sourceTable);
161
164
            
162
            DatabaseField fkField = primaryKeyJoinColumn.getForeignKeyField();
165
            DatabaseField fkField = primaryKeyJoinColumn.getForeignKeyField();
163
            fkField.setName(getName(fkField, pkField.getName(), FK_CTX));
166
            fkField.setName(getName(fkField, pkField.getName(), FK_CTX));
164
            fkField.setTable(targetTable);
167
            fkField.setTable(targetTable);
Lines 184-195 Link Here
184
            if (metadataClass.isAnnotationPresent(MappedSuperclass.class)) {
187
            if (metadataClass.isAnnotationPresent(MappedSuperclass.class)) {
185
                m_mappedSuperclasses.add(new MappedSuperclassAccessor(
188
                m_mappedSuperclasses.add(new MappedSuperclassAccessor(
186
                        metadataClass.getAnnotation(MappedSuperclass.class), metadataClass, getDescriptor()));
189
                        metadataClass.getAnnotation(MappedSuperclass.class), metadataClass, getDescriptor()));
187
                // 266912: store the mapped superclass as a descriptor on the project for later use by the Metamodel API
190
                // 266912: process and store mappedSuperclass descriptors on the project for later use by the Metamodel API
188
                getProject().addMappedSuperclassToProject(metadataClass);
191
                MappedSuperclassAccessor msAccessor = new MappedSuperclassAccessor(
192
                        metadataClass.getAnnotation(MappedSuperclass.class), 
193
                        metadataClass,
194
                        getProject());
195
                // process what type of access is on the superclass (in case inheriting members differ in their access type)
196
                getProject().addMappedSuperclassAccessor(metadataClass, msAccessor);
189
            }
197
            }
190
        } else {
198
        } else {
191
            // TODO: 266912 add descriptor for xml clients
199
            MappedSuperclassAccessor msAccessor = reloadMappedSuperclass(accessor, getDescriptor());
192
            m_mappedSuperclasses.add(reloadMappedSuperclass(accessor, getDescriptor()));
200
            m_mappedSuperclasses.add(msAccessor);
201
            // 266912: process and store mappedSuperclass descriptors on the project for later use by the Metamodel API
202
            getProject().addMappedSuperclassAccessor(metadataClass, msAccessor);
193
        }
203
        }
194
    }
204
    }
195
    
205
    
Lines 245-251 Link Here
245
            
255
            
246
                // We found a parent entity.
256
                // We found a parent entity.
247
                if (parentAccessor != null) {
257
                if (parentAccessor != null) {
248
                    // Set the immediate parent's descriptor the current descriptor.
258
                    // Set the immediate parent's descriptor to the current descriptor.
249
                    currentAccessor.getDescriptor().setInheritanceParentDescriptor(parentAccessor.getDescriptor());
259
                    currentAccessor.getDescriptor().setInheritanceParentDescriptor(parentAccessor.getDescriptor());
250
                
260
                
251
                    // Remember the last accessor first ...
261
                    // Remember the last accessor first ...
Lines 808-814 Link Here
808
     *     entity-mappings setting.    
818
     *     entity-mappings setting.    
809
     * 6 - we have exhausted our search, default to FIELD.
819
     * 6 - we have exhausted our search, default to FIELD.
810
     */
820
     */
811
    protected void processAccessType() {
821
    public void processAccessType() {
822
        // 266912: this function has been partially overridden in the MappedSuperclassAccessor parent
823
        // do not call the superclass method in MappedSuperclassAccessor
812
        // Step 1 - Check for an explicit setting.
824
        // Step 1 - Check for an explicit setting.
813
        String explicitAccessType = getAccess(); 
825
        String explicitAccessType = getAccess(); 
814
        
826
        
Lines 1417-1423 Link Here
1417
        // our composite primary key attributes were validated. 
1429
        // our composite primary key attributes were validated. 
1418
        if (getDescriptor().hasCompositePrimaryKey()) {
1430
        if (getDescriptor().hasCompositePrimaryKey()) {
1419
            if (getDescriptor().pkClassWasNotValidated()) {
1431
            if (getDescriptor().pkClassWasNotValidated()) {
1420
                throw ValidationException.invalidCompositePKSpecification(getJavaClass(), getDescriptor().getPKClassName());
1432
                // 266912: relax restrictions for MappedSuperclass defined PK's
1433
                if(!getDescriptor().isPkClassDefinedOnMappedSuperclass()) {
1434
                    throw ValidationException.invalidCompositePKSpecification(getJavaClass(), getDescriptor().getPKClassName());
1435
                }
1421
            }
1436
            }
1422
        } else {
1437
        } else {
1423
            // Descriptor has a single primary key. Validate an id 
1438
            // Descriptor has a single primary key. Validate an id 
Lines 1428-1431 Link Here
1428
            }
1443
            }
1429
        }  
1444
        }  
1430
    }
1445
    }
1446
    
1447
    @Override
1448
    protected boolean hasMappedSuperclasses() {
1449
        return this.m_mappedSuperclasses.size() > 0;
1450
    }
1451
    
1431
}
1452
}
(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/classes/MappedSuperclassAccessor.java (+64 lines)
Lines 31-36 Link Here
31
package org.eclipse.persistence.internal.jpa.metadata.accessors.classes;
31
package org.eclipse.persistence.internal.jpa.metadata.accessors.classes;
32
32
33
import java.util.ArrayList;
33
import java.util.ArrayList;
34
import java.util.Iterator;
34
import java.util.List;
35
import java.util.List;
35
36
36
import javax.persistence.AssociationOverride;
37
import javax.persistence.AssociationOverride;
Lines 76-81 Link Here
76
77
77
import org.eclipse.persistence.internal.jpa.metadata.locking.OptimisticLockingMetadata;
78
import org.eclipse.persistence.internal.jpa.metadata.locking.OptimisticLockingMetadata;
78
79
80
import org.eclipse.persistence.internal.jpa.metadata.MetadataConstants;
79
import org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor;
81
import org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor;
80
import org.eclipse.persistence.internal.jpa.metadata.MetadataLogger;
82
import org.eclipse.persistence.internal.jpa.metadata.MetadataLogger;
81
import org.eclipse.persistence.internal.jpa.metadata.MetadataProject;
83
import org.eclipse.persistence.internal.jpa.metadata.MetadataProject;
Lines 1147-1151 Link Here
1147
    public void setReadOnly(Boolean readOnly) {
1149
    public void setReadOnly(Boolean readOnly) {
1148
        m_readOnly = readOnly;
1150
        m_readOnly = readOnly;
1149
    }
1151
    }
1152
    
1153
    /**
1154
     * INTERNAL:
1155
     * Used to process mapped superclasses when creating descriptors for a metamodel.
1156
     * @since EclipseLink 2.0 for the JPA 2.0 Reference Implementation
1157
     */
1158
    public void processMetamodelDescriptor() {        
1159
        for(Iterator<MappedSuperclassAccessor> mappedSuperclassIterator = 
1160
            getProject().getMappedSuperclassAccessors().values().iterator();
1161
            mappedSuperclassIterator.hasNext();) {
1162
            mappedSuperclassIterator.next().processAccessors();
1163
        }
1164
    }
1165
    
1166
    /**
1167
     * INTERNAL:
1168
     * Process the accessType for a MappedSuperclass.
1169
     * This function is referenced by MetadataProject.addMappedSuperclassAccessor().
1170
     * The overridden function on the subclass must be used in all other cases.
1171
     * @since EclipseLink 2.0 for the JPA 2.0 Reference Implementation
1172
     */
1173
    public void processAccessType() {
1174
        // 266912: Note: this function is a port of the subclass protected EntityAccessor.processAccessType() minus step 1 and 2
1175
        String explicitAccessType = getAccess(); 
1176
        String defaultAccessType = null;
1177
        // 3 - If there are no mapped superclasses or no mapped superclasses
1178
        // without an explicit access type. Check where the annotations are
1179
        // defined on this entity class.
1180
        if (havePersistenceFieldAnnotationsDefined(getJavaClass().getFields().values())) {
1181
            defaultAccessType = MetadataConstants.FIELD;
1182
        } else if (havePersistenceMethodAnnotationsDefined(getJavaClass().getMethods().values())) {
1183
            defaultAccessType = MetadataConstants.PROPERTY;
1184
        } else {
1185
            // 4 - If there are no annotations defined on either the
1186
            // fields or properties, check for an xml default from
1187
            // persistence-unit-metadata-defaults or entity-mappings.
1188
            if (getDescriptor().getDefaultAccess() != null) {
1189
                defaultAccessType = getDescriptor().getDefaultAccess();
1190
            } else {
1191
                // 5 - We've exhausted our search, set the access type to FIELD.
1192
                defaultAccessType = MetadataConstants.FIELD;
1193
            }
1194
        }
1195
        
1196
        // Finally set the default access type on the descriptor and log a 
1197
        // message to the user if we are defaulting the access type for this
1198
        // entity to use that default.
1199
        getDescriptor().setDefaultAccess(defaultAccessType);
1200
        
1201
        if (explicitAccessType == null) {
1202
            getLogger().logConfigMessage(MetadataLogger.ACCESS_TYPE, defaultAccessType, getJavaClass());
1203
        }
1204
    }
1205
1206
    /**
1207
     * INTERNAL:
1208
     * Referenced by MetadataProject.addMappedSuperclassAccessor()
1209
     * @return
1210
     */
1211
    public MetadataClass getIdClass() {
1212
        return m_idClass;
1213
    }
1150
}
1214
}
1151
1215
(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/mappings/BasicAccessor.java (-22 lines)
Lines 25-32 Link Here
25
 *       - 241413: JPA 2.0 Add EclipseLink support for Map type attributes
25
 *       - 241413: JPA 2.0 Add EclipseLink support for Map type attributes
26
 *     04/24/2009-2.0 Guy Pelletier 
26
 *     04/24/2009-2.0 Guy Pelletier 
27
 *       - 270011: JPA 2.0 MappedById support
27
 *       - 270011: JPA 2.0 MappedById support
28
 *     04/30/2009-2.0 Michael O'Brien 
29
 *       - 266912: JPA 2.0 Metamodel API (part of Criteria API)
30
 ******************************************************************************/  
28
 ******************************************************************************/  
31
package org.eclipse.persistence.internal.jpa.metadata.accessors.mappings;
29
package org.eclipse.persistence.internal.jpa.metadata.accessors.mappings;
32
30
Lines 326-351 Link Here
326
        if (m_sequenceGenerator != null) {
324
        if (m_sequenceGenerator != null) {
327
            getProject().addSequenceGenerator(m_sequenceGenerator);
325
            getProject().addSequenceGenerator(m_sequenceGenerator);
328
        }
326
        }
329
        
330
        // 266912: Also, add mapping to the mapped superclass descriptor collection on the project
331
        // This object could be URL, Class, Method or Field
332
        Object key = this.getClassAccessor().getLocation();
333
        // Get mapped superclass on the descriptor if present
334
        ClassAccessor classAccessor = getClassAccessor();
335
        if(classAccessor.isMappedSuperclass()) {
336
            RelationalDescriptor msDescriptor = getProject().getMappedSuperclassFromProject(key);
337
            // we only handle classes and skip, Methods, Fields and URLs
338
            if(null != msDescriptor) {
339
                // Do we clone this mapping (yes if we customize it for the mappedSuperclass)
340
                DirectToFieldMapping msMapping = (DirectToFieldMapping)mapping.clone(); // deep copy
341
                // remove pointer to old descriptor (inheriting child class)
342
                msMapping.setDescriptor(null);
343
                // add mapping to new descriptor and vice-versa
344
                msDescriptor.addMapping(msMapping);
345
                // TODO: set the javaClass now on the descriptor - as we have the correct classLoader
346
                //msDescriptor.setJavaClass(theJavaClass);         
347
            }
348
        }        
349
    }
327
    }
350
328
351
    /**
329
    /**
(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/mappings/DirectCollectionAccessor.java (-3 / +20 lines)
Lines 151-157 Link Here
151
    @Override
151
    @Override
152
    public MetadataClass getReferenceClass() {
152
    public MetadataClass getReferenceClass() {
153
        MetadataClass cls = getReferenceClassFromGeneric();
153
        MetadataClass cls = getReferenceClassFromGeneric();
154
        return (cls == null) ? getMetadataFactory().getClassMetadata(void.class.getName()) : cls;
154
        if(cls == null) {
155
            cls = getMetadataFactory().getClassMetadata(void.class.getName());
156
157
            // 266912: We do not currently handle resolution of the generic type when inherited from a parent MappedSuperclasses
158
            if(cls == null) {
159
                if(this.getClassAccessor().isMappedSuperclass()) {
160
                // default to void
161
                return new MetadataClass(this.getMetadataFactory(), Void.class);
162
                }
163
            }
164
165
        }
166
        return cls;
155
    }
167
    }
156
    
168
    
157
    /**
169
    /**
Lines 311-317 Link Here
311
        // value. If none is found then we'll look for a JPA converter, that 
323
        // value. If none is found then we'll look for a JPA converter, that 
312
        // is, Enumerated, Lob and Temporal. With everything falling into 
324
        // is, Enumerated, Lob and Temporal. With everything falling into 
313
        // a serialized mapping if no converter whatsoever is found.
325
        // a serialized mapping if no converter whatsoever is found.
314
        processMappingValueConverter(mapping, getValueConverter(), getReferenceClass());
326
        
327
        // 266912: Do not process MappingAccessors for MappedSuperclass descriptors
328
        if(!this.getClassAccessor().isMappedSuperclass()) {
329
            processMappingValueConverter(mapping, getValueConverter(), getReferenceClass());
330
        }
315
    }
331
    }
316
    
332
    
317
    /**
333
    /**
Lines 331-337 Link Here
331
        // call to processConverter, since it may set a field classification)
347
        // call to processConverter, since it may set a field classification)
332
        mapping.setDirectKeyField(getDatabaseField(getReferenceDatabaseTable(), MetadataLogger.MAP_KEY_COLUMN));
348
        mapping.setDirectKeyField(getDatabaseField(getReferenceDatabaseTable(), MetadataLogger.MAP_KEY_COLUMN));
333
        
349
        
334
        // Only process the key converter is this is a basic map accessor. The
350
        // Only process the key converter if this is a basic map accessor. The
335
        // key converter for an element collection case will be taken care of
351
        // key converter for an element collection case will be taken care of
336
        // in the processContainerPolicyAndIndirection call above.
352
        // in the processContainerPolicyAndIndirection call above.
337
        if (isBasicMap()) {
353
        if (isBasicMap()) {
Lines 344-349 Link Here
344
        mapping.setDirectField(getDatabaseField(getReferenceDatabaseTable(), MetadataLogger.VALUE_COLUMN));
360
        mapping.setDirectField(getDatabaseField(getReferenceDatabaseTable(), MetadataLogger.VALUE_COLUMN));
345
        
361
        
346
        // Process a converter for value column of this mapping.
362
        // Process a converter for value column of this mapping.
363
        // TODO: 266912: avoid this for MappedSuperclass descriptors
347
        processMappingValueConverter(mapping, getValueConverter(), getReferenceClass());    
364
        processMappingValueConverter(mapping, getValueConverter(), getReferenceClass());    
348
    }
365
    }
349
    
366
    
(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/mappings/ElementCollectionAccessor.java (+8 lines)
Lines 404-409 Link Here
404
     * INTERNAL:
404
     * INTERNAL:
405
     * If a targetEntity is specified in metadata, it will be set as the 
405
     * If a targetEntity is specified in metadata, it will be set as the 
406
     * reference class, otherwise we will look to extract one from generics.
406
     * reference class, otherwise we will look to extract one from generics.
407
     * <p>
408
     * MappedSuperclass descriptors return Void
407
     */
409
     */
408
    @Override
410
    @Override
409
    public MetadataClass getReferenceClass() {
411
    public MetadataClass getReferenceClass() {
Lines 415-420 Link Here
415
                m_referenceClass = getReferenceClassFromGeneric();
417
                m_referenceClass = getReferenceClassFromGeneric();
416
        
418
        
417
                if (m_referenceClass == null) {
419
                if (m_referenceClass == null) {
420
                    // 266912: We do not currently handle resolution of the generic type when inherited from a parent MappedSuperclasses
421
                   if(this.getClassAccessor().isMappedSuperclass()) {
422
                        // default to void
423
                        return new MetadataClass(this.getMetadataFactory(), Void.class);
424
                    }
425
                    
418
                    // Throw an exception. An element collection accessor must 
426
                    // Throw an exception. An element collection accessor must 
419
                    // have a reference class either through generics or a 
427
                    // have a reference class either through generics or a 
420
                    // specified target class on the mapping metadata.
428
                    // specified target class on the mapping metadata.
(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/mappings/MappingAccessor.java (-10 / +32 lines)
Lines 30-35 Link Here
30
 *       - 270011: JPA 2.0 MappedById support
30
 *       - 270011: JPA 2.0 MappedById support
31
 *     06/02/2009-2.0 Guy Pelletier 
31
 *     06/02/2009-2.0 Guy Pelletier 
32
 *       - 278768: JPA 2.0 Association Override Join Table
32
 *       - 278768: JPA 2.0 Association Override Join Table
33
 *     06/23/2009-2.0 Michael O'Brien 
34
 *       - 266912: change MappedSuperclass handling in stage2 to pre process accessors 
33
 ******************************************************************************/
35
 ******************************************************************************/
34
package org.eclipse.persistence.internal.jpa.metadata.accessors.mappings;
36
package org.eclipse.persistence.internal.jpa.metadata.accessors.mappings;
35
37
Lines 456-471 Link Here
456
        }
458
        }
457
        
459
        
458
        if (descriptor.hasCompositePrimaryKey()) {
460
        if (descriptor.hasCompositePrimaryKey()) {
459
            // The number of join columns should equal the number of primary key fields.
461
            // 266912: Relax constraints for MappedSuperclass descriptors
460
            if (joinColumns.size() != descriptor.getPrimaryKeyFields().size()) {
462
            if(!descriptor.hasDescriptorReservedForMetamodelAsParent()) {
461
                throw ValidationException.incompleteJoinColumnsSpecified(getAnnotatedElement(), getJavaClass());
463
                // The number of join columns should equal the number of primary key fields.
462
            }
464
                if (joinColumns.size() != descriptor.getPrimaryKeyFields().size()) {
463
            
464
            // All the primary and foreign key field names should be specified.
465
            for (JoinColumnMetadata joinColumn : joinColumns) {
466
                if (joinColumn.isPrimaryKeyFieldNotSpecified() || joinColumn.isForeignKeyFieldNotSpecified()) {
467
                    throw ValidationException.incompleteJoinColumnsSpecified(getAnnotatedElement(), getJavaClass());
465
                    throw ValidationException.incompleteJoinColumnsSpecified(getAnnotatedElement(), getJavaClass());
468
                }
466
                }
467
            
468
                // All the primary and foreign key field names should be specified.
469
                for (JoinColumnMetadata joinColumn : joinColumns) {
470
                    if (joinColumn.isPrimaryKeyFieldNotSpecified() || joinColumn.isForeignKeyFieldNotSpecified()) {
471
                        throw ValidationException.incompleteJoinColumnsSpecified(getAnnotatedElement(), getJavaClass());
472
                    }
473
                }
469
            }
474
            }
470
        }
475
        }
471
        
476
        
Lines 519-524 Link Here
519
                throw ValidationException.unableToDetermineMapKeyClass(getAttributeName(), getJavaClass());
524
                throw ValidationException.unableToDetermineMapKeyClass(getAttributeName(), getJavaClass());
520
            }
525
            }
521
        
526
        
527
            // 266912: We do not currently handle resolution of the generic type when inherited from a parent MappedSuperclasses
528
            if(this.getClassAccessor().isMappedSuperclass()) {
529
                // default to void
530
                return new MetadataClass(this.getMetadataFactory(), Void.class);
531
            }
532
            
522
            return referenceClass;
533
            return referenceClass;
523
        } else {
534
        } else {
524
            return getMetadataFactory().getClassMetadata(void.class.getName());
535
            return getMetadataFactory().getClassMetadata(void.class.getName());
Lines 568-574 Link Here
568
     * Return the reference class name for this accessor.
579
     * Return the reference class name for this accessor.
569
     */
580
     */
570
    public String getReferenceClassName() {
581
    public String getReferenceClassName() {
571
        return getReferenceClass().getName();
582
        if(null != getReferenceClass()) {
583
            return getReferenceClass().getName();
584
        } else {
585
            // Relax constraints for MappedSuperclass descriptors
586
            if(!this.getClassAccessor().isMappedSuperclass()) {
587
                return "";
588
            } else {
589
                return null;
590
            }
591
        }
572
    }
592
    }
573
    
593
    
574
    /**
594
    /**
Lines 1271-1277 Link Here
1271
     */
1291
     */
1272
    protected String processMapKey(String mapKey, CollectionMapping mapping) {
1292
    protected String processMapKey(String mapKey, CollectionMapping mapping) {
1273
        MetadataDescriptor referenceDescriptor = getReferenceDescriptor();
1293
        MetadataDescriptor referenceDescriptor = getReferenceDescriptor();
1274
            
1294
        if(referenceDescriptor.hasDescriptorReservedForMetamodelAsParent()) {
1295
            return null;
1296
        }
1275
        if ((mapKey == null || mapKey.equals("")) && referenceDescriptor.hasCompositePrimaryKey()) {
1297
        if ((mapKey == null || mapKey.equals("")) && referenceDescriptor.hasCompositePrimaryKey()) {
1276
            // No persistent property or field name has been provided, and the 
1298
            // No persistent property or field name has been provided, and the 
1277
            // reference class has a composite primary key class.  Return null,
1299
            // reference class has a composite primary key class.  Return null,
(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/objects/MetadataAnnotatedElement.java (-1 / +8 lines)
Lines 240-246 Link Here
240
                // Assume is a generic type variable, find real type.
240
                // Assume is a generic type variable, find real type.
241
                elementClass = descriptor.getGenericType(elementClass);
241
                elementClass = descriptor.getGenericType(elementClass);
242
            }            
242
            }            
243
            return getMetadataFactory().getClassMetadata(elementClass);
243
            MetadataClass metadataClass = getMetadataFactory().getClassMetadata(elementClass);
244
            // 266912: We do not currently handle resolution of the generic type when inherited from a parent MappedSuperclasses
245
            if(null == metadataClass && descriptor.getClassAccessor().isMappedSuperclass()) {
246
                // default to void
247
                return new MetadataClass(this.getMetadataFactory(), Void.class);
248
            } else {
249
                return metadataClass;
250
            }
244
        } else {
251
        } else {
245
            return null;
252
            return null;
246
        }
253
        }
(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/inheritance/InheritanceMetadata.java (-3 / +8 lines)
Lines 81-86 Link Here
81
     * INTERNAL:
81
     * INTERNAL:
82
     * The process method method will be called with the descriptor from
82
     * The process method method will be called with the descriptor from
83
     * every entity in the hierarchy.
83
     * every entity in the hierarchy.
84
     * <p>
85
     * MappedSuperclass descriptors are partially processed.
84
     */
86
     */
85
    public void process(MetadataDescriptor descriptor) {
87
    public void process(MetadataDescriptor descriptor) {
86
        EntityAccessor accessor = (EntityAccessor) descriptor.getClassAccessor();
88
        EntityAccessor accessor = (EntityAccessor) descriptor.getClassAccessor();
Lines 139-146 Link Here
139
                    // We have metadata we need to set on our root parent.
141
                    // We have metadata we need to set on our root parent.
140
                    addClassIndicator(rootDescriptor, accessor);
142
                    addClassIndicator(rootDescriptor, accessor);
141
                    
143
                    
142
                    // Process join columns if necessary.
144
                    // Process join columns if necessary.                    
143
                    if (rootAccessor.getInheritance().usesJoinedStrategy()) {
145
                    if (rootAccessor.getInheritance().usesJoinedStrategy() ) {//&& !rootAccessor.getDescriptor().hasDescriptorReservedForMetamodelAsParent()) {
144
                        accessor.processInheritancePrimaryKeyJoinColumns();
146
                        accessor.processInheritancePrimaryKeyJoinColumns();
145
                    }
147
                    }
146
                }
148
                }
Lines 149-155 Link Here
149
            // If the root descriptor has an id class, we need to set the same 
151
            // If the root descriptor has an id class, we need to set the same 
150
            // id class on our descriptor.
152
            // id class on our descriptor.
151
            if (descriptor.getInheritanceRootDescriptor().hasCompositePrimaryKey()) {
153
            if (descriptor.getInheritanceRootDescriptor().hasCompositePrimaryKey()) {
152
                descriptor.setPKClass(descriptor.getInheritanceRootDescriptor().getPKClass());
154
                // 266912: metamodel processing exclusions for MappedSuperclass PK classes
155
                if(null != descriptor.getInheritanceRootDescriptor().getPKClass()) { 
156
                    descriptor.setPKClass(descriptor.getInheritanceRootDescriptor().getPKClass());
157
                }
153
            }
158
            }
154
        } else {
159
        } else {
155
            // Since Inheritance hierarchies are processed from the top most
160
            // Since Inheritance hierarchies are processed from the top most
(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/MetadataConstants.java (+7 lines)
Lines 29-32 Link Here
29
    /** AccessType enum values */
29
    /** AccessType enum values */
30
    public static final String FIELD = "FIELD";
30
    public static final String FIELD = "FIELD";
31
    public static final String PROPERTY = "PROPERTY";
31
    public static final String PROPERTY = "PROPERTY";
32
33
    /** Metamodel processing for MappedSuperclasses non-functional names */
34
    public static final String MAPPED_SUPERCLASS_RESERVED_PK_NAME = "__PK_METAMODEL_RESERVED_IN_MEM_ONLY_FIELD_NAME";
35
    public static final String MAPPED_SUPERCLASS_RESERVED_TABLE_NAME = "__METAMODEL_RESERVED_IN_MEM_ONLY_TABLE_NAME";    
36
    public static final String MAPPED_SUPERCLASS_RESERVED_PK_QUALIFIED_NAME = "qualified.__PK_METAMODEL_RESERVED_IN_MEM_ONLY_FIELD_NAME";
37
    public static final String MAPPED_SUPERCLASS_RESERVED_TABLE_QUALIFIED_NAME = "qualified.__METAMODEL_RESERVED_IN_MEM_ONLY_TABLE_NAME";    
38
32
}
39
}
(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/MetadataDescriptor.java (-1 / +57 lines)
Lines 45-50 Link Here
45
import java.util.ArrayList;
45
import java.util.ArrayList;
46
import java.util.Collection;
46
import java.util.Collection;
47
import java.util.HashMap;
47
import java.util.HashMap;
48
import java.util.Iterator;
48
import java.util.List;
49
import java.util.List;
49
import java.util.Map;
50
import java.util.Map;
50
51
Lines 111-117 Link Here
111
    private ClassAccessor m_classAccessor;
112
    private ClassAccessor m_classAccessor;
112
    private ClassDescriptor m_descriptor;
113
    private ClassDescriptor m_descriptor;
113
    private DatabaseTable m_primaryTable;
114
    private DatabaseTable m_primaryTable;
114
    // The embedded id accessor for this descritor if one exists.
115
    // The embedded id accessor for this descriptor if one exists.
115
    private EmbeddedIdAccessor m_embeddedIdAccessor;
116
    private EmbeddedIdAccessor m_embeddedIdAccessor;
116
    
117
    
117
    private List<String> m_idAttributeNames;
118
    private List<String> m_idAttributeNames;
Lines 285-290 Link Here
285
     * INTERNAL:
286
     * INTERNAL:
286
     */
287
     */
287
    public void addForeignKeyFieldForMultipleTable(DatabaseField fkField, DatabaseField pkField) {
288
    public void addForeignKeyFieldForMultipleTable(DatabaseField fkField, DatabaseField pkField) {
289
        // 266912: relax restrictions for MappedSuperclass descriptors
290
        if(this.hasDescriptorReservedForMetamodelAsParent()) {
291
            if (!fkField.hasTableName()) {
292
                fkField.setTableName(MetadataConstants.MAPPED_SUPERCLASS_RESERVED_TABLE_QUALIFIED_NAME);//PK_NAME);
293
            }
294
            if (!pkField.hasTableName()) {
295
                pkField.setTableName(MetadataConstants.MAPPED_SUPERCLASS_RESERVED_TABLE_QUALIFIED_NAME);
296
            }
297
        }
298
288
        m_descriptor.addForeignKeyFieldForMultipleTable(fkField, pkField);
299
        m_descriptor.addForeignKeyFieldForMultipleTable(fkField, pkField);
289
        m_pkJoinColumnAssociations.put(fkField.getName(), pkField.getName());
300
        m_pkJoinColumnAssociations.put(fkField.getName(), pkField.getName());
290
    }
301
    }
Lines 872-877 Link Here
872
                return new DatabaseTable();
883
                return new DatabaseTable();
873
            }
884
            }
874
            
885
            
886
            // 266912: return a reserved table name for Metamodel processing
887
            if(hasDescriptorReservedForMetamodelAsParent()) {
888
                return new DatabaseTable();
889
            }
875
            return m_primaryTable;
890
            return m_primaryTable;
876
        }
891
        }
877
    }
892
    }
Lines 1589-1592 Link Here
1589
            }
1604
            }
1590
        }
1605
        }
1591
    }
1606
    }
1607
    
1608
    /**
1609
     * INTERNAL:
1610
     * Return whether the PK or part of a composite PK was defined on a MappedSuperclass.
1611
     * We do this to relax validation restrictions in this case.
1612
     */
1613
    public boolean isPkClassDefinedOnMappedSuperclass() {
1614
        for(Iterator<String> anIterator = m_pkClassIDs.keySet().iterator(); anIterator.hasNext();) {
1615
            String pkField = anIterator.next();
1616
            if(MetadataConstants.MAPPED_SUPERCLASS_RESERVED_PK_NAME.equals(pkField)) {
1617
                // Use case is a MappedSuperclass composite PK in between two entity classes
1618
                return true;
1619
            }
1620
        }
1621
        
1622
        return false;
1623
    }
1624
    
1625
    /**
1626
     * INTERNAL:
1627
     * This function is used by Accessors to determine whether the 
1628
     * RelationalDescriptor on the MetadataDescriptor is reserved solely for
1629
     * Metamodel processing.<p>
1630
     * In this case validation may be relaxed as processing will not proceed to the database.
1631
     * <p>
1632
     * @return
1633
     */
1634
    public boolean hasDescriptorReservedForMetamodelAsParent() {
1635
        if(this.getClassDescriptor() != null && this.getClassDescriptor().getTableName() != null &&
1636
                this.getClassDescriptor().getTableName().equals(
1637
                        MetadataConstants.MAPPED_SUPERCLASS_RESERVED_TABLE_NAME)) {
1638
            return true;
1639
        } else {
1640
            // check the inheriting superclass for our reserved table name
1641
            if(this.isInheritanceSubclass()) {
1642
                return this.getInheritanceParentDescriptor().hasDescriptorReservedForMetamodelAsParent();                
1643
            }
1644
        }
1645
        return false;
1646
    }
1647
    
1592
}
1648
}
(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/MetadataProject.java (-22 / +89 lines)
Lines 31-36 Link Here
31
 *       - 266912: change mappedSuperclassDescriptors Set to a Map
31
 *       - 266912: change mappedSuperclassDescriptors Set to a Map
32
 *          keyed on MetadataClass - avoiding the use of a hashCode/equals
32
 *          keyed on MetadataClass - avoiding the use of a hashCode/equals
33
 *          override on RelationalDescriptor, but requiring a contains check prior to a put
33
 *          override on RelationalDescriptor, but requiring a contains check prior to a put
34
 *     06/18/2009-2.0 Michael O'Brien 
35
 *       - 266912: change MappedSuperclass handling in stage2 to pre process accessors 
34
 ******************************************************************************/  
36
 ******************************************************************************/  
35
package org.eclipse.persistence.internal.jpa.metadata;
37
package org.eclipse.persistence.internal.jpa.metadata;
36
38
Lines 186-191 Link Here
186
    // the correct owning descriptor.
188
    // the correct owning descriptor.
187
    private HashSet<EmbeddableAccessor> m_rootEmbeddableAccessors;
189
    private HashSet<EmbeddableAccessor> m_rootEmbeddableAccessors;
188
    
190
    
191
    // All mappedSuperclass accessors, identity is handled by keying on className
192
    private HashMap<String, MappedSuperclassAccessor> m_mappedSuperclassAccessors;
193
    
189
    /**
194
    /**
190
     * INTERNAL:
195
     * INTERNAL:
191
     * Create and return a new MetadataProject with puInfo as its PersistenceUnitInfo, 
196
     * Create and return a new MetadataProject with puInfo as its PersistenceUnitInfo, 
Lines 228-233 Link Here
228
        m_converters = new HashMap<String, AbstractConverterMetadata>();
233
        m_converters = new HashMap<String, AbstractConverterMetadata>();
229
        
234
        
230
        m_accessorsWithDerivedIDs = new HashSet<ClassAccessor>();
235
        m_accessorsWithDerivedIDs = new HashSet<ClassAccessor>();
236
        
237
        m_mappedSuperclassAccessors = new HashMap<String, MappedSuperclassAccessor>();
231
    }
238
    }
232
    
239
    
233
    /**
240
    /**
Lines 972-978 Link Here
972
            // into Descriptors and Login
979
            // into Descriptors and Login
973
            boolean usesAuto = false;
980
            boolean usesAuto = false;
974
            for (MetadataClass entityClass : m_generatedValues.keySet()) {
981
            for (MetadataClass entityClass : m_generatedValues.keySet()) {
975
                MetadataDescriptor descriptor = m_allAccessors.get(entityClass.getName()).getDescriptor();
982
                // 266912: skip setting sequences if our accessor is null for mappedSuperclasses
983
                ClassAccessor accessor = m_allAccessors.get(entityClass.getName());
984
                // TODO: fully review this if check
985
                // If the accessor is not found then it should be in our processing map for MappedSuperclasses
986
                if(null == accessor) {
987
                    accessor = this.m_mappedSuperclassAccessors.get(entityClass.getName());
988
                }
989
990
                MetadataDescriptor descriptor = accessor.getDescriptor();
976
                GeneratedValueMetadata generatedValue = m_generatedValues.get(entityClass);
991
                GeneratedValueMetadata generatedValue = m_generatedValues.get(entityClass);
977
                String generatorName = generatedValue.getGenerator();
992
                String generatorName = generatedValue.getGenerator();
978
                
993
                
Lines 1022-1028 Link Here
1022
                    login.addSequence(sequence);
1037
                    login.addSequence(sequence);
1023
                } else {
1038
                } else {
1024
                    String seqName;
1039
                    String seqName;
1025
                    
1040
                   
1026
                    if (generatorName.equals("")) {
1041
                    if (generatorName.equals("")) {
1027
                        if (defaultAutoSequence != null) {
1042
                        if (defaultAutoSequence != null) {
1028
                            seqName = defaultAutoSequence.getName();
1043
                            seqName = defaultAutoSequence.getName();
Lines 1036-1042 Link Here
1036
                    descriptor.setSequenceNumberName(seqName);
1051
                    descriptor.setSequenceNumberName(seqName);
1037
                }
1052
                }
1038
            }
1053
            }
1039
            
1054
                    
1040
            if (usesAuto) {
1055
            if (usesAuto) {
1041
                if (defaultAutoSequence != null) {
1056
                if (defaultAutoSequence != null) {
1042
                    login.setDefaultSequence(defaultAutoSequence);
1057
                    login.setDefaultSequence(defaultAutoSequence);
Lines 1093-1100 Link Here
1093
     * @see processStage3
1108
     * @see processStage3
1094
     */
1109
     */
1095
    public void processStage2() {
1110
    public void processStage2() {
1096
        // Mapped superclasses and embeddables are processed through the entity 
1111
        // 266912: process mappedSuperclasses without going to the database
1097
        // processing.
1112
        for(MappedSuperclassAccessor msAccessor : m_mappedSuperclassAccessors.values()) {
1113
            if(!msAccessor.isProcessed()) {               
1114
                msAccessor.processMetamodelDescriptor();    
1115
            }
1116
        }
1117
        
1098
        for (EntityAccessor entity : getEntityAccessors()) {
1118
        for (EntityAccessor entity : getEntityAccessors()) {
1099
            // If the accessor hasn't been processed yet, then process it. An
1119
            // If the accessor hasn't been processed yet, then process it. An
1100
            // EntityAccessor may get fast tracked if it is an inheritance
1120
            // EntityAccessor may get fast tracked if it is an inheritance
Lines 1123-1129 Link Here
1123
1143
1124
        // 2 - Process all the direct collection accessors we found. This list
1144
        // 2 - Process all the direct collection accessors we found. This list
1125
        // does not include direct collections to an embeddable class.
1145
        // does not include direct collections to an embeddable class.
1126
        processDirectCollectionAccessors();
1146
         processDirectCollectionAccessors();
1127
        
1147
        
1128
        // 3 - Process the sequencing metadata now that every entity has a 
1148
        // 3 - Process the sequencing metadata now that every entity has a 
1129
        // validated primary key.
1149
        // validated primary key.
Lines 1211-1235 Link Here
1211
    
1231
    
1212
    /**
1232
    /**
1213
     * INTERNAL:
1233
     * INTERNAL:
1214
     * Add new descriptors for these mapped superclasses to the core project.
1234
     *     The metamodel API requires that descriptors exist for 
1215
     * The metadataProject handles interaction with the native project.
1235
     * mappedSuperclasses in order to obtain their mappings.<p>
1236
     *     In order to accomplish this, this method that is called from EntityAccessor 
1237
     * will ensure that the descriptors on all mappedSuperclass accessors 
1238
     * are setup so that they can be specially processed later in 
1239
     * MetadataProject.processStage2() - where the m_mappedSuperclassAccessors 
1240
     * Set is required.
1241
     * <p>
1242
     *  This method is referenced by EntityAccessor.addPotentialMappedSuperclass()
1243
     *  </p>
1244
     * @param metadataClass - the 
1245
     * @param accessor - The mappedSuperclass accessor for the field on the mappedSuperclass<p>
1246
     * @since EclipseLink 2.0 for the JPA 2.0 Reference Implementation
1216
     */    
1247
     */    
1217
    public void addMappedSuperclassToProject(MetadataClass metadataClass) {
1248
    public void addMappedSuperclassAccessor(MetadataClass metadataClass, MappedSuperclassAccessor accessor) {
1218
        // 266912: store the mapped superclass as a descriptor on the project
1249
        // If metadataClass is null, then get it from the location on the accessor
1219
        // for later use by the Metamodel API
1250
        String className = metadataClass.getName();
1220
        // We pass through here more than once - we rely on the Set implementation to handle no duplicates
1251
        
1221
        RelationalDescriptor msDescriptor = new RelationalDescriptor();
1252
        // check for an existing entry before proceeding - as a Map.put() will replace the existing accessor
1222
        msDescriptor.setAlias(metadataClass.getName());
1253
        // TODO: handle equal classnames for different classLoaders in multiple containers
1223
        // Set the javaClassName only on the descriptor and use this as the key
1254
        if(null != className && !m_mappedSuperclassAccessors.containsKey(className)) {
1224
        // when the descriptor is part of a set
1255
            accessor.processAccessType();
1225
        // The javaClass itself will be set on the descriptor later when we have the correct classLoader
1256
            // Generics Handler: Check if the referenceType is not set for Collection accessors
1226
        msDescriptor.setJavaClassName(metadataClass.getName());
1257
            accessor.addAccessors();
1227
        // Add the mapped superclass to the native project keyed by MetadataClass
1258
            m_mappedSuperclassAccessors.put(className, accessor);
1228
        m_session.getProject().addMappedSuperclass(metadataClass, msDescriptor);
1259
            RelationalDescriptor descriptor = (RelationalDescriptor)accessor.getDescriptor().getClassDescriptor();
1229
    }    
1260
            // Fake out a database table and primary key
1261
            // We require string names for table processing that does not actually goto the database.
1262
            // There will be no conflict with customer values
1263
            // The descriptor is assumed never to be null
1264
            if(null == descriptor.getTableName() && descriptor.getPrimaryKeyFieldNames().isEmpty()) {
1265
                descriptor.setTableName(MetadataConstants.MAPPED_SUPERCLASS_RESERVED_TABLE_NAME);
1266
                descriptor.setPrimaryKeyFieldName(MetadataConstants.MAPPED_SUPERCLASS_RESERVED_PK_NAME);
1267
                // TODO: handle multiple table PK fields using a FK
1268
                if(accessor.getIdClassName() != null) {
1269
                    descriptor.addPrimaryKeyFieldName(MetadataConstants.MAPPED_SUPERCLASS_RESERVED_PK_NAME);
1270
                    accessor.getDescriptor().addPKClassId(MetadataConstants.MAPPED_SUPERCLASS_RESERVED_PK_NAME,
1271
                            accessor.getIdClassName());
1272
                }
1273
            }
1274
            // The javaClassName is set, the javaClass itself will be set on the descriptor later when we have the correct classLoader
1275
            // We store our descriptor on the core project for later retrieval by MetamodelImpl
1276
            m_session.getProject().addMappedSuperclass(metadataClass, descriptor);
1277
        } // TODO: verify that the first accessor is sufficient and that we do not require replacement of merging
1278
    }
1230
1279
1231
    /**
1280
    /**
1232
     * INTERNAL:
1281
     * INTERNAL:
1282
     * Return the Set of MappedSuperclassAccessors
1283
     * @since EclipseLink 2.0 for the JPA 2.0 Reference Implementation
1284
     */
1285
    public HashMap<String, MappedSuperclassAccessor> getMappedSuperclassAccessors() {
1286
        return m_mappedSuperclassAccessors;
1287
    }
1288
    
1289
    /**
1290
     * INTERNAL:
1233
     * get the mapped superclasses stored on the core project.
1291
     * get the mapped superclasses stored on the core project.
1234
     * The metadataProject handles interaction with the native project.
1292
     * The metadataProject handles interaction with the native project.
1235
     * @param metadataClass - java class name key is extracted from the MetadataClass
1293
     * @param metadataClass - java class name key is extracted from the MetadataClass
Lines 1245-1249 Link Here
1245
        return relationalDescriptor;
1303
        return relationalDescriptor;
1246
    }    
1304
    }    
1247
    
1305
    
1248
}
1306
    /**
1307
     * INTERNAL:
1308
     * Return whether the project contains a mappedSuperclass matching the metadataClass
1309
     * @param metadataClass
1310
     */
1311
    public boolean hasMappedSuperclassAccessor(MetadataClass metadataClass) {
1312
        return m_mappedSuperclasses.containsKey(metadataClass.getName());
1313
    }
1314
    
1315
 }
1249
1316

Return to bug 266912