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 267391 | Differences between
and this patch

Collapse All | Expand All

(-)foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/localization/i18n/LoggingLocalizationResource.java (-2 / +4 lines)
Lines 632-639 Link Here
632
        { "jmx_mbean_runtime_services_mbeanserver_lookup_failed.MSGID", "TOP-50230"},
632
        { "jmx_mbean_runtime_services_mbeanserver_lookup_failed.MSGID", "TOP-50230"},
633
        { "jmx_mbean_runtime_services_threadpool_initialize_failed.MSGID", "TOP-50231"},
633
        { "jmx_mbean_runtime_services_threadpool_initialize_failed.MSGID", "TOP-50231"},
634
        { "jmx_mbean_runtime_services_get_executethreadruntime_object_failed.MSGID", "TOP-50232"},        
634
        { "jmx_mbean_runtime_services_get_executethreadruntime_object_failed.MSGID", "TOP-50232"},        
635
        { "nested_entity_manager_flush_not_executed_pre_query_changes_may_be_pending.MSGID", "TOP-50233"}
635
        { "nested_entity_manager_flush_not_executed_pre_query_changes_may_be_pending.MSGID", "TOP-50233"},
636
        
636
        { "metamodel_canonical_model_classes_not_found", "Canonical Metamodel classes found during initialization"},
637
        { "metamodel_canonical_model_classes_found", "No Canonical Metamodel classes found during initialization"}        
638
637
    }; 
639
    }; 
638
     
640
     
639
    /**
641
    /**
(-)foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/logging/SessionLog.java (-1 / +2 lines)
Lines 105-114 Link Here
105
    public static final String EJB = "ejb";
105
    public static final String EJB = "ejb";
106
    public static final String DMS = "dms";
106
    public static final String DMS = "dms";
107
    public static final String EJB_OR_METADATA = "ejb_or_metadata";
107
    public static final String EJB_OR_METADATA = "ejb_or_metadata";
108
    public static final String METAMODEL = "jpa_metamodel";
108
    public static final String WEAVER = "weaver";
109
    public static final String WEAVER = "weaver";
109
    public static final String PROPERTIES = "properties";
110
    public static final String PROPERTIES = "properties";
110
    public static final String SERVER = "server";
111
    public static final String SERVER = "server";
111
    public final String[] loggerCatagories = new String[] { SQL ,TRANSACTION ,EVENT ,CONNECTION ,QUERY ,CACHE ,PROPAGATION ,SEQUENCING ,EJB ,DMS ,EJB_OR_METADATA ,WEAVER ,PROPERTIES ,SERVER};
112
    public final String[] loggerCatagories = new String[] { SQL ,TRANSACTION ,EVENT ,CONNECTION ,QUERY ,CACHE ,PROPAGATION ,SEQUENCING ,EJB ,DMS ,EJB_OR_METADATA, METAMODEL ,WEAVER ,PROPERTIES ,SERVER};
112
113
113
    /**
114
    /**
114
     * PUBLIC:
115
     * PUBLIC:
(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/EntityManagerFactoryImpl.java (-1 / +46 lines)
Lines 18-24 Link Here
18
import javax.persistence.*;
18
import javax.persistence.*;
19
import javax.persistence.criteria.QueryBuilder;
19
import javax.persistence.criteria.QueryBuilder;
20
import javax.persistence.metamodel.Metamodel;
20
import javax.persistence.metamodel.Metamodel;
21
21
import javax.persistence.metamodel.Attribute;
22
import javax.persistence.metamodel.ManagedType;
22
import org.eclipse.persistence.config.EntityManagerProperties;
23
import org.eclipse.persistence.config.EntityManagerProperties;
23
import org.eclipse.persistence.config.FlushClearCache;
24
import org.eclipse.persistence.config.FlushClearCache;
24
import org.eclipse.persistence.internal.jpa.querydef.QueryBuilderImpl;
25
import org.eclipse.persistence.internal.jpa.querydef.QueryBuilderImpl;
Lines 26-31 Link Here
26
import org.eclipse.persistence.internal.sessions.PropertiesHandler;
27
import org.eclipse.persistence.internal.sessions.PropertiesHandler;
27
import org.eclipse.persistence.sessions.factories.ReferenceMode;
28
import org.eclipse.persistence.sessions.factories.ReferenceMode;
28
import org.eclipse.persistence.sessions.server.ServerSession;
29
import org.eclipse.persistence.sessions.server.ServerSession;
30
import org.eclipse.persistence.internal.security.PrivilegedAccessHelper;
31
import org.eclipse.persistence.logging.SessionLog;
32
import org.eclipse.persistence.exceptions.ValidationException;
29
33
30
/**
34
/**
31
 * <p>
35
 * <p>
Lines 416-421 Link Here
416
	}
420
	}
417
421
418
    /**
422
    /**
423
     * Initialize the Canonical Meta Model classes generated by EclipseLink
424
     */
425
    protected void initializeCanonicalMetamodel(Metamodel model) {
426
427
        boolean classesInitialized = false;
428
        for (ManagedType manType : model.getManagedTypes()) {
429
            String originalClassName = manType.getJavaType().getName();
430
            String canonicalClassName = originalClassName + "_";  
431
            // TODO: suffix should be read from the propery when that is supported
432
            // TODO: Also need to support a seperate package location when the property exists.
433
434
            try {
435
                Class clazz = setupImpl.getPersistenceUnitInfo().getClassLoader().loadClass(canonicalClassName); // is this the right loader?
436
                classesInitialized = true;
437
                String fieldName = "";
438
                for(Object attribute : manType.getDeclaredAttributes()) { 
439
                    try {
440
                        fieldName = ((Attribute)attribute).getName();
441
                        PrivilegedAccessHelper.getField(clazz, fieldName, false).set(clazz, attribute);                      
442
                    }
443
                    catch (Exception e) {
444
                       throw ValidationException.invalidFieldForClass(fieldName, clazz);
445
                    }
446
                }
447
448
            } catch (ClassNotFoundException exception){
449
                //Do Nothing.    
450
            }
451
        }
452
        if (classesInitialized) {
453
            getServerSession().log(SessionLog.FINER, SessionLog.METAMODEL, "metamodel_canonical_model_classes_found");
454
        } else {
455
            getServerSession().log(SessionLog.FINER, SessionLog.METAMODEL, "metamodel_canonical_model_classes_not_found");
456
        }
457
458
	}
459
460
    /**
419
     * Return an instance of Metamodel interface for access to the
461
     * Return an instance of Metamodel interface for access to the
420
     * metamodel of the persistence unit.
462
     * metamodel of the persistence unit.
421
     * @return Metamodel instance
463
     * @return Metamodel instance
Lines 431-436 Link Here
431
        // perform lazy initialization
473
        // perform lazy initialization
432
        if(null == metaModel) {
474
        if(null == metaModel) {
433
            metaModel = new org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl(this);
475
            metaModel = new org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl(this);
476
            //If the canonical metamodel classes exist, initialize them
477
            initializeCanonicalMetamodel(metaModel);
478
434
        }
479
        }
435
        return metaModel;
480
        return metaModel;
436
    }
481
    }

Return to bug 267391