Examples of EntityAccessor


Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor

        keyMapping.setReferenceClassName(mapKeyClassName);
        keyMapping.dontUseIndirection();
        keyMapping.setDescriptor(getDescriptor().getClassDescriptor());
       
        // Process the map key join columns.
        EntityAccessor mapKeyAccessor = getProject().getEntityAccessor(mapKeyClassName);
        MetadataDescriptor mapKeyClassDescriptor = mapKeyAccessor.getDescriptor();
       
        // If the fk field (name) is not specified, it defaults to the
        // concatenation of the following: the name of the referencing
        // relationship property or field of the referencing entity or
        // embeddable; "_"; "KEY"
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor

     * with the subclasses context (that is, the descriptor we are given).
     */
    protected EntityAccessor reloadEntity(EntityAccessor entity, MetadataDescriptor descriptor) {
        if (getEntityMappings() == null) {
            // Create a new EntityAccesor.
            EntityAccessor entityAccessor = new EntityAccessor(entity.getAnnotation(), entity.getJavaClass(), entity.getProject());
            // Things we care about ...
            descriptor.setDefaultAccess(entity.getDescriptor().getDefaultAccess());
            entityAccessor.setDescriptor(descriptor);
            return entityAccessor;           
        } else {
            return getEntityMappings().reloadEntity(entity, descriptor);
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor

            MetadataClass candidateClass = m_factory.getMetadataClass(className);
            // Bug 227630: Do not process a null class whether it was from a
            // NPE or a CNF, a warning or exception is thrown in loadClass()
            if (candidateClass != null) {
                if (PersistenceUnitProcessor.isEntity(candidateClass) && ! m_project.hasEntity(candidateClass)) {
                    m_project.addEntityAccessor(new EntityAccessor(PersistenceUnitProcessor.getEntityAnnotation(candidateClass), candidateClass, m_project));
                } else if (PersistenceUnitProcessor.isEmbeddable(candidateClass) && ! m_project.hasEmbeddable(candidateClass)) {
                    m_project.addEmbeddableAccessor(new EmbeddableAccessor(PersistenceUnitProcessor.getEmbeddableAnnotation(candidateClass), candidateClass, m_project));
                } else if (PersistenceUnitProcessor.isStaticMetamodelClass(candidateClass)) {
                    m_project.addStaticMetamodelClass(PersistenceUnitProcessor.getStaticMetamodelAnnotation(candidateClass), candidateClass);
                }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor

           
        // Reload the xml entity mappings object
        xmlEntityMappings = reloadXMLEntityMappingsObject(xmlEntityMappings);
           
        // Initialize the newly loaded/built entity
        EntityAccessor entity = xmlEntityMappings.getEntities().get(0);
        MetadataClass metadataClass = getMetadataFactory().getMetadataClass(getPackageQualifiedClassName(entity.getClassName()));
        entity.initXMLClassAccessor(metadataClass, descriptor, m_project, this);
       
        return entity;
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor

        keyMapping.setReferenceClassName(mapKeyClassName);
        keyMapping.dontUseIndirection();
        keyMapping.setDescriptor(getDescriptor().getClassDescriptor());
       
        // Process the map key join columns.
        EntityAccessor mapKeyAccessor = getProject().getEntityAccessor(mapKeyClassName);
        MetadataDescriptor mapKeyClassDescriptor = mapKeyAccessor.getDescriptor();
       
        // If the pk field (referencedColumnName) is not specified, it
        // defaults to the primary key of the referenced table.
        String defaultPKFieldName = mapKeyClassDescriptor.getPrimaryKeyFieldName();
       
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor

           
        // Reload the xml entity mappings object
        xmlEntityMappings = reloadXMLEntityMappingsObject(xmlEntityMappings);
           
        // Initialize the newly loaded/built entity
        EntityAccessor entity = xmlEntityMappings.getEntities().get(0);
        MetadataClass metadataClass = getMetadataFactory().getMetadataClass(getPackageQualifiedClassName(entity.getClassName()));
        entity.initXMLClassAccessor(metadataClass, descriptor, m_project, this);
       
        return entity;
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor

        keyMapping.setReferenceClassName(mapKeyClassName);
        keyMapping.dontUseIndirection();
        keyMapping.setDescriptor(getDescriptor().getClassDescriptor());
       
        // Process the map key join columns.
        EntityAccessor mapKeyAccessor = getProject().getEntityAccessor(mapKeyClassName);
        MetadataDescriptor mapKeyClassDescriptor = mapKeyAccessor.getDescriptor();
       
        // If the pk field (referencedColumnName) is not specified, it
        // defaults to the primary key of the referenced table.
        String defaultPKFieldName = mapKeyClassDescriptor.getPrimaryKeyFieldName();
       
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor

     * with the subclasses context (that is, the descriptor we are given).
     */
    protected EntityAccessor reloadEntity(EntityAccessor entity, MetadataDescriptor descriptor) {
        if (getEntityMappings() == null) {
            // Create a new EntityAccesor.
            EntityAccessor entityAccessor = new EntityAccessor(entity.getAnnotation(), entity.getJavaClass(), entity.getProject());
            // Things we care about ...
            descriptor.setDefaultAccess(entity.getDescriptor().getDefaultAccess());
            entityAccessor.setDescriptor(descriptor);
            return entityAccessor;           
        } else {
            return getEntityMappings().reloadEntity(entity, descriptor);
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor

            MetadataClass candidateClass = m_factory.getMetadataClass(className);
            // Bug 227630: Do not process a null class whether it was from a
            // NPE or a CNF, a warning or exception is thrown in loadClass()
            if (candidateClass != null) {
                if (PersistenceUnitProcessor.isEntity(candidateClass) && ! m_project.hasEntity(candidateClass)) {
                    m_project.addEntityAccessor(new EntityAccessor(PersistenceUnitProcessor.getEntityAnnotation(candidateClass), candidateClass, m_project));
                } else if (PersistenceUnitProcessor.isEmbeddable(candidateClass) && ! m_project.hasEmbeddable(candidateClass)) {
                    m_project.addEmbeddableAccessor(new EmbeddableAccessor(PersistenceUnitProcessor.getEmbeddableAnnotation(candidateClass), candidateClass, m_project));
                } else if (PersistenceUnitProcessor.isStaticMetamodelClass(candidateClass)) {
                    m_project.addStaticMetamodelClass(PersistenceUnitProcessor.getStaticMetamodelAnnotation(candidateClass), candidateClass);
                }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor

        // Remove the accessor from other maps if the type changed.
        removeEmbeddableAccessor(metadataClass);
        removeMappedSuperclassAccessor(metadataClass);
       
        if (project.hasEntity(metadataClass)) {
            EntityAccessor entityAccessor = project.getEntityAccessor(metadataClass);
           
            // Don't touch it if it was loaded from XML.
            if (! entityAccessor.loadedFromXML()) {
                if (excludeUnlistedClasses(metadataClass)) {
                    // remove it!
                    removeEntityAccessor(metadataClass);
                } else {
                    // override it!
                    project.addEntityAccessor(new EntityAccessor(metadataClass.getAnnotation(Entity.class), metadataClass, project));
                }
            }
        } else if (! excludeUnlistedClasses(metadataClass)) {
            // add it!
            project.addEntityAccessor(new EntityAccessor(metadataClass.getAnnotation(Entity.class), metadataClass, project));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.