Package oracle.toplink.essentials.internal.ejb.cmp3.metadata

Examples of oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataDescriptor


     *
     * Be careful while changing order of processing.
     */
    protected MetadataDescriptor processEmbeddableClass() {
        final Class embeddableClass = getReferenceClass();
        MetadataDescriptor embeddableDescriptor = null;

        try {
            embeddableDescriptor = m_project.getDescriptor(embeddableClass);
        } catch (Exception exception) {
            // expected as we do lazy processing of embeddables.
        }

        if (embeddableDescriptor == null) {
            // The embeddable class is not yet processed, so process it now.
            embeddableDescriptor = new MetadataDescriptor(embeddableClass);
            // adding to projects sets up appropriate persistence-unit-defaults
            m_project.addDescriptor(embeddableDescriptor);
            embeddableDescriptor.setIgnoreAnnotations(isMetadataComplete(embeddableDescriptor));
            AccessType accessType = determineAccessTypeOfEmbedded(embeddableDescriptor);
            embeddableDescriptor.setUsesPropertyAccess(accessType == PROPERTY ? true : false);
            ClassAccessor embeddableAccessor = buildAccessor(embeddableDescriptor);
            embeddableAccessor.process();
            embeddableAccessor.setIsProcessed();
        } else {
            // We have already processed this embeddable class. let's validate
            // that it is not used in entities with conflicting access type.
            // Conflicting access-type is not allowed when there is no metadata
            // in the embeddable class.
            if (!isMetadataPresent(embeddableDescriptor)) {
                boolean embeddableUsesPropertyAccess = embeddableDescriptor.usesPropertyAccess();
                boolean entityUsesPropertyAccess = m_descriptor.usesPropertyAccess();

                if (embeddableUsesPropertyAccess != entityUsesPropertyAccess) {
                    m_validator.throwConflictingAccessTypeInEmbeddable(embeddableClass);
                }
View Full Code Here


     * that includes XML and annotations.
     */
    public MetadataProcessor(PersistenceUnitInfo puInfo, AbstractSession session, ClassLoader loader, boolean enableLazyForOneToOne) {
        m_loader = loader;
        m_session = session;
        m_logger = new MetadataLogger(session);
        m_project = new MetadataProject(puInfo, session, enableLazyForOneToOne);
    }
View Full Code Here

        for (Class entity : entities) {
            m_project.addDescriptor(new MetadataDescriptor(entity));
            entityNames.add(entity.getName());
        }
        m_project.setWeavableClassNames(entityNames);
        m_logger = new MetadataLogger(session);
    }
View Full Code Here

    /**
     * INTERNAL:
     * Process the information contained in the entity-mappings node.
     */
    public void processEntityMappings() {
        MetadataPersistenceUnit persistenceUnit = m_project.getPersistenceUnit();
       
        if (persistenceUnit != null) {
            // Use the persistent unit defaults ..
            XMLClassAccessor.m_entityMappingsAccess = m_helper.getNodeTextValue(XMLConstants.ENTITY_MAPPINGS, XMLConstants.ACCESS, persistenceUnit.getAccess());
            XMLClassAccessor.m_entityMappingsSchema = m_helper.getNodeTextValue(XMLConstants.ENTITY_MAPPINGS, XMLConstants.SCHEMA, persistenceUnit.getSchema());
            XMLClassAccessor.m_entityMappingsCatalog = m_helper.getNodeTextValue(XMLConstants.ENTITY_MAPPINGS, XMLConstants.CATALOG, persistenceUnit.getCatalog());
        } else {
            XMLClassAccessor.m_entityMappingsAccess = m_helper.getNodeTextValue(XMLConstants.ENTITY_MAPPINGS, XMLConstants.ACCESS);
            XMLClassAccessor.m_entityMappingsSchema = m_helper.getNodeTextValue(XMLConstants.ENTITY_MAPPINGS, XMLConstants.SCHEMA);
            XMLClassAccessor.m_entityMappingsCatalog = m_helper.getNodeTextValue(XMLConstants.ENTITY_MAPPINGS, XMLConstants.CATALOG);
        }
View Full Code Here

         }
       
        session.getPlatform().setConversionManager(new EJB30ConversionManager());

        // Create an instance of MetadataProcessor for specified persistence unit info
        MetadataProcessor processor = new MetadataProcessor(unitInfo, session, privateClassLoader, true);
        // Process the Object/relational metadata from XML and annotations.
        PersistenceUnitProcessor.processORMetadata(processor,privateClassLoader, session, false);

        //Collection entities = buildEntityList(persistenceUnitInfo, privateClassLoader);
        Collection entities = PersistenceUnitProcessor.buildEntityList(processor,privateClassLoader);
View Full Code Here

     * INTERNAL: (Overidden in XMLClassAccessor and XMLEmbeddedAccessor)
     * Fast track processing a ClassAccessor for the given descriptor.
     * Inheritance root classes and embeddables may be fast tracked.
     */
    protected ClassAccessor processAccessor(MetadataDescriptor descriptor) {
        ClassAccessor accessor = new ClassAccessor(new MetadataClass(descriptor.getJavaClass()), getProcessor(), descriptor);
        descriptor.setClassAccessor(accessor);
        accessor.process();
        return accessor;
    }
View Full Code Here

     * session. This call is made from the EntityManagerSetup deploy call.
     */
    public void addEntityListeners() {
        for (MetadataDescriptor descriptor: m_project.getDescriptors()) {
            // Process all descriptors that are in our project.
            ClassAccessor accessor = descriptor.getClassAccessor();
           
            descriptor.setJavaClass(descriptor.getClassDescriptor().getJavaClass());
            // The class loader has changed, update the class stored for
            // our class accessor and its list of mapped superclasses.
            accessor.setAnnotatedElement(descriptor.getJavaClass());
            accessor.clearMappedSuperclasses();           
           
            accessor.processListeners(m_loader);
        }
    }
View Full Code Here

        // take a copy of the collection to avoid concurrent modification exception
        // that would result when embeddables are added lazily.
        for (MetadataDescriptor descriptor:
             m_project.getDescriptors().toArray(new MetadataDescriptor[]{})) {
            // Process all descriptors that are in our project.
            ClassAccessor accessor = descriptor.getClassAccessor();
               
            // If there is no accessor on this descriptor then it has not been
            // processed yet. Create one and process it.
            if (accessor == null) {
                accessor = new ClassAccessor(new MetadataClass(descriptor.getJavaClass()), this, descriptor);
                descriptor.setClassAccessor(accessor);
                accessor.process();
            }
        }
       
        // Process the project and anything that was deferred like
        // sequencing and relationship mappings and we are done.
View Full Code Here

                    Node entityNode = entityNodes.item(i);
                    Class entityClass = helper.getClassForNode(entityNode);
                    MetadataDescriptor descriptor = m_project.getDescriptor(entityClass);

                    // Process all descriptors that are in our project.
                    ClassAccessor accessor = descriptor.getClassAccessor();

                    // If there is no accessor on this descriptor then it has not
                    // been processed yet. Create one and process it.
                    if (accessor == null) {
                        accessor = new XMLClassAccessor(new MetadataClass(descriptor.getJavaClass()), entityNode, helper, this, descriptor);
                        descriptor.setClassAccessor(accessor);
                        accessor.process();
                    }
                }
            }
        } else {
            // There are no classes to process ...
View Full Code Here

     * object given. Order of checking is important, careful when modifying
     * or adding, check what the isXyz call does to determine if the accessor
     * is of type xyz.
     */
    protected MetadataAccessor buildAccessor(MetadataAccessibleObject accessibleObject) {
        MetadataAccessor accessor = m_descriptor.getAccessorFor(accessibleObject.getAttributeName());
       
        if (accessor == null) {
            if (MetadataHelper.isBasic(accessibleObject, m_descriptor)) {
                return new BasicAccessor(accessibleObject, this);
            } else if (MetadataHelper.isEmbedded(accessibleObject, m_descriptor)) {
View Full Code Here

TOP

Related Classes of oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.