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

Examples of oracle.toplink.essentials.internal.ejb.cmp3.base.CMP3Policy$FieldAccessor


  protected void processTable() {
        if (m_descriptor.ignoreTables()) {
            m_logger.logWarningMessage(m_logger.IGNORE_TABLE_ANNOTATION, getJavaClass());
        } else {
            Table table = getAnnotation(Table.class);
            processTable(new MetadataTable(table, m_logger));
        }
    }
View Full Code Here


     * Fast track processing a ClassAccessor for the given descriptor.
     * Inheritance root classes and embeddables may be fast tracked.
     */
    protected ClassAccessor processAccessor(MetadataDescriptor descriptor) {
        Node node = null;
        XMLHelper xmlhelper = null;
       
        node = m_helper.locateEntityNode(descriptor.getJavaClass());
       
        if(node!=null){
            xmlhelper = m_helper;
        } else {
            //Bug#2962 Cover the case when the given descriptor defined in the separate mapping XML file rather than
            //the one referred by m_helper.
            for (Map.Entry<URL, Document> urlToDocPair : m_project.getMappingFiles().entrySet()) {
                Document document = (Document)urlToDocPair.getValue();
                xmlhelper = new XMLHelper(document, urlToDocPair.getKey().getFile(), m_helper.getClassLoader());
                node = xmlhelper.locateEntityNode(descriptor.getJavaClass());
                if(node!=null){
                    break;
                }
            }
        }
View Full Code Here

                    // for mapped superclasses if they are not directly above
                    // us before the next entity in the hierarchy.
                    break;
                } else if (m_project.hasMappedSuperclass(parent)) {
                    Node node = m_project.getMappedSuperclassNode(parent);
                    XMLHelper helper = m_project.getMappedSuperclassHelper(parent);                   
                    m_mappedSuperclasses.add(new XMLMappedSuperclassAccessor(new MetadataClass(parent), node, helper, m_processor, m_descriptor));
                } else if (isAnnotationPresent(MappedSuperclass.class, parent)) {
                    m_mappedSuperclasses.add(new MappedSuperclassAccessor(new MetadataClass(parent), m_processor, m_descriptor));
                }
               
View Full Code Here

     */
    public Set<String> buildPersistenceUnitClassSetFromXMLDocuments() {
        HashSet<String> classSet = new HashSet<String>();
       
        for (Map.Entry<URL, Document> urlToDoc : m_project.getMappingFiles().entrySet()) {
            XMLHelper helper = new XMLHelper(urlToDoc.getValue(), urlToDoc.getKey().getFile(), m_loader);
       
            // Process the package node.
            String defaultPkg = helper.getNodeValue(new String[] {XMLConstants.ENTITY_MAPPINGS, XMLConstants.PACKAGE, XMLConstants.TEXT});

            // Handle entities only unless otherwise specified to.
            classSet.addAll(buildEntityClassSetForNodeList(helper, XMLConstants.ENTITY, defaultPkg));
            classSet.addAll(buildEntityClassSetForNodeList(helper, XMLConstants.EMBEDDABLE, defaultPkg));
            classSet.addAll(buildEntityClassSetForNodeList(helper, XMLConstants.MAPPED_SUPERCLASS, defaultPkg));
View Full Code Here

     * Process the xml and fill in the project. Process the entity-mappings
     * information then process the entities.
     */
    private void processMappingFile(Document document, String fileName) {
        if (m_project.hasDescriptors()) {
            XMLHelper helper = new XMLHelper(document, fileName, m_loader);

            // Process the entity mappings ... this is a crude way of doing
            // things ... but hey ... the clock is ticking ...
            MetadataDescriptor desc = m_project.getDescriptors().iterator().next();
            XMLClassAccessor dummyAccessor = new XMLClassAccessor(new MetadataClass(desc.getJavaClass()), null, helper, this, desc);
            dummyAccessor.processEntityMappings();

            // Process the entity nodes for this xml document.
            NodeList entityNodes = helper.getNodes(XMLConstants.ENTITY_MAPPINGS, XMLConstants.ENTITY);

            if (entityNodes != null) {
                for (int i = 0; i < entityNodes.getLength(); i++) {
                    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();

View Full Code Here

        }

        // Iterate though the classes that are defined in XML.
        for (Map.Entry<URL, Document> urlToDoc : m_project.getMappingFiles().entrySet()) {
            //classSet.addAll(buildEntityClassSetFromXMLDocument(urlToDoc.getValue(), urlToDoc.getKey().getFile(), m_loader, includeMappedSuperclasses, includeEmbeddables));
            XMLHelper helper = new XMLHelper(urlToDoc.getValue(), urlToDoc.getKey().getFile(), m_loader);
       
            // Process the package node.
            String defaultPkg = helper.getNodeValue(new String[] {XMLConstants.ENTITY_MAPPINGS, XMLConstants.PACKAGE, XMLConstants.TEXT});

            // Add the entities to the entity and weavable class list.
            Set<String> xmlEntityClassNames = buildEntityClassSetForNodeList(helper, XMLConstants.ENTITY, defaultPkg);
            entityClassNames.addAll(xmlEntityClassNames);
            weavableClassNames.addAll(xmlEntityClassNames);
View Full Code Here

        } else if (nodeName.equals(XMLConstants.EMBEDDED_ID)) {
            return new XMLEmbeddedIdAccessor(accessibleObject, node, this);
        } else if (nodeName.equals(XMLConstants.TRANSIENT)) {
            return new XMLTransientAccessor(accessibleObject, node, this);
        } else {
            return new XMLBasicAccessor(accessibleObject, node, this);
        }
    }
View Full Code Here

            XMLHelper helper = new XMLHelper(document, fileName, m_loader);

            // Process the entity mappings ... this is a crude way of doing
            // things ... but hey ... the clock is ticking ...
            MetadataDescriptor desc = m_project.getDescriptors().iterator().next();
            XMLClassAccessor dummyAccessor = new XMLClassAccessor(new MetadataClass(desc.getJavaClass()), null, helper, this, desc);
            dummyAccessor.processEntityMappings();

            // Process the entity nodes for this xml document.
            NodeList entityNodes = helper.getNodes(XMLConstants.ENTITY_MAPPINGS, XMLConstants.ENTITY);

            if (entityNodes != null) {
                for (int i = 0; i < entityNodes.getLength(); i++) {
                    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();
                    }
                }
            }
View Full Code Here

            } else {
                m_validator.throwInvalidCollectionTypeForRelationship(getJavaClass(), accessibleObject.getRawClass(), getAttributeName());
                return null;
            }
        } else if (nodeName.equals(XMLConstants.EMBEDDED)) {
            return new XMLEmbeddedAccessor(accessibleObject, node, this);
        } else if (nodeName.equals(XMLConstants.EMBEDDED_ID)) {
            return new XMLEmbeddedIdAccessor(accessibleObject, node, this);
        } else if (nodeName.equals(XMLConstants.TRANSIENT)) {
            return new XMLTransientAccessor(accessibleObject, node, this);
        } else {
View Full Code Here

                m_validator.throwInvalidCollectionTypeForRelationship(getJavaClass(), accessibleObject.getRawClass(), getAttributeName());
                return null;
            }
        } else if (nodeName.equals(XMLConstants.MANY_TO_MANY)) {
            if (MetadataHelper.isSupportedCollectionClass(accessibleObject.getRawClass())) {
                return new XMLManyToManyAccessor(accessibleObject, node, this);
            } else {
                m_validator.throwInvalidCollectionTypeForRelationship(getJavaClass(), accessibleObject.getRawClass(), getAttributeName());
                return null;
            }
        } else if (nodeName.equals(XMLConstants.EMBEDDED)) {
View Full Code Here

TOP

Related Classes of oracle.toplink.essentials.internal.ejb.cmp3.base.CMP3Policy$FieldAccessor

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.