Package org.eclipse.persistence.queries

Examples of org.eclipse.persistence.queries.SQLResultSetMapping


        // Clear old descriptors to allow rehash on new classes.
        this.descriptors = new HashMap();
        // convert class names to classes for each SQLResultSetMapping
        if (sqlResultSetMappings != null) {
            for (Iterator mappingIt = sqlResultSetMappings.keySet().iterator(); mappingIt.hasNext();) {
                SQLResultSetMapping mapping = (SQLResultSetMapping) sqlResultSetMappings.get(mappingIt.next());
                mapping.convertClassNamesToClasses(classLoader);
            }
        }
    }
View Full Code Here


        // Clear old descriptors to allow rehash on new classes.
        this.descriptors = new HashMap();
        // convert class names to classes for each SQLResultSetMapping
        if (sqlResultSetMappings != null) {
            for (Iterator mappingIt = sqlResultSetMappings.keySet().iterator(); mappingIt.hasNext();) {
                SQLResultSetMapping mapping = (SQLResultSetMapping) sqlResultSetMappings.get(mappingIt.next());
                mapping.convertClassNamesToClasses(classLoader);
            }
        }
    }
View Full Code Here

     * Process an sql result set mapping metadata into a EclipseLink
     * SqlResultSetMapping and store it on the session.
     */
    public void process(AbstractSession session, ClassLoader loader) {       
        // Initialize a new SqlResultSetMapping (with the metadata name)
        SQLResultSetMapping mapping = new SQLResultSetMapping(getName());
       
        // Process the entity results.
        for (EntityResultMetadata eResult : m_entityResults) {
            EntityResult entityResult = new EntityResult(MetadataHelper.getClassForName(eResult.getEntityClass().getName(), loader));
       
            // Process the field results.
            if (eResult.hasFieldResults()) {
                for (FieldResultMetadata fResult : eResult.getFieldResults()) {
                    entityResult.addFieldResult(new FieldResult(fResult.getName(), fResult.getColumn()));
                }
            }
       
            // Process the discriminator value;
            entityResult.setDiscriminatorColumn(eResult.getDiscriminatorColumn());
       
            // Add the result to the SqlResultSetMapping.
            mapping.addResult(entityResult);
        }
       
        // Process the column results.
        for (String columnResult : m_columnResults) {
            mapping.addResult(new ColumnResult(columnResult));
        }
           
        session.getProject().addSQLResultSetMapping(mapping);
    }
View Full Code Here

     * rely on convert class names to classes to be called (it's already been
     * called)
     */
    public SQLResultSetMapping process(ClassLoader loader) {       
        // Initialize a new SqlResultSetMapping (with the metadata name)
        SQLResultSetMapping mapping = new SQLResultSetMapping(getName());
       
        // Process the entity results first.
        for (EntityResultMetadata entityResult : m_entityResults) {
            mapping.addResult(entityResult.process(loader));
        }
           
        // Process the constructor results second.
        for (ConstructorResultMetadata constructorResult : m_constructorResults) {
            mapping.addResult(constructorResult.process(loader));
        }
       
        // Process the column results third.
        for (ColumnResultMetadata columnResult : m_columnResults) {
            mapping.addResult(columnResult.process(loader));
        }
       
        return mapping;
    }
View Full Code Here

     * Process an sql result set mapping metadata into a EclipseLink
     * SqlResultSetMapping and store it on the session.
     */
    public void process(AbstractSession session, ClassLoader loader, MetadataProject project) {       
        // Initialize a new SqlResultSetMapping (with the metadata name)
        SQLResultSetMapping mapping = new SQLResultSetMapping(getName());
       
        // Process the entity results.
        for (EntityResultMetadata eResult : m_entityResults) {
            EntityResult entityResult = new EntityResult(MetadataHelper.getClassForName(eResult.getEntityClass().getName(), loader));
       
            // Process the field results.
            if (eResult.hasFieldResults()) {
                for (FieldResultMetadata fResult : eResult.getFieldResults()) {
                    FieldResult fieldResult = new FieldResult(fResult.getName(), fResult.getColumn());
                    if (project.useDelimitedIdentifier()) {
                        fieldResult.getColumn().setUseDelimiters(true);
                    } else if (project.getShouldForceFieldNamesToUpperCase() && !fieldResult.getColumn().shouldUseDelimiters()) {
                        fieldResult.getColumn().useUpperCaseForComparisons(true);
                    }
                    entityResult.addFieldResult(fieldResult);
                }
            }
       
            // Process the discriminator value;
            if (eResult.getDiscriminatorColumn() !=null){
                DatabaseField descriminatorField = new DatabaseField(eResult.getDiscriminatorColumn());
                if (project.useDelimitedIdentifier()) {
                    descriminatorField.setUseDelimiters(true);
                } else if (project.getShouldForceFieldNamesToUpperCase() && !descriminatorField.shouldUseDelimiters()){
                    descriminatorField.useUpperCaseForComparisons(true);
                }
                entityResult.setDiscriminatorColumn(descriminatorField);
            }
       
            // Add the result to the SqlResultSetMapping.
            mapping.addResult(entityResult);
        }
       
        // Process the column results.
        for (String columnResult : m_columnResults) {
            ColumnResult result = new ColumnResult(columnResult);
            if (project.useDelimitedIdentifier()) {
                result.getColumn().setUseDelimiters(true);
            }
            if (project.getShouldForceFieldNamesToUpperCase()) {
                result.getColumn().useUpperCaseForComparisons(true);
            }
            mapping.addResult(result);
        }
           
        session.getProject().addSQLResultSetMapping(mapping);
    }
View Full Code Here

     * Process an sql result set mapping metadata into a EclipseLink
     * SqlResultSetMapping and store it on the session.
     */
    public void process(AbstractSession session, ClassLoader loader) {       
        // Initialize a new SqlResultSetMapping (with the metadata name)
        SQLResultSetMapping mapping = new SQLResultSetMapping(getName());
       
        // Process the entity results.
        for (EntityResultMetadata eResult : m_entityResults) {
            EntityResult entityResult = new EntityResult(MetadataHelper.getClassForName(eResult.getEntityClass().getName(), loader));
       
            // Process the field results.
            if (eResult.hasFieldResults()) {
                for (FieldResultMetadata fResult : eResult.getFieldResults()) {
                    entityResult.addFieldResult(new FieldResult(fResult.getName(), fResult.getColumn()));
                }
            }
       
            // Process the discriminator value;
            entityResult.setDiscriminatorColumn(eResult.getDiscriminatorColumn());
       
            // Add the result to the SqlResultSetMapping.
            mapping.addResult(entityResult);
        }
       
        // Process the column results.
        for (String columnResult : m_columnResults) {
            mapping.addResult(new ColumnResult(columnResult));
        }
           
        session.getProject().addSQLResultSetMapping(mapping);
    }
View Full Code Here

     * Process an sql result set mapping metadata into a EclipseLink
     * SqlResultSetMapping and store it on the session.
     */
    public void process(AbstractSession session, ClassLoader loader, MetadataProject project) {       
        // Initialize a new SqlResultSetMapping (with the metadata name)
        SQLResultSetMapping mapping = new SQLResultSetMapping(getName());
       
        // Process the entity results.
        for (EntityResultMetadata eResult : m_entityResults) {
            EntityResult entityResult = new EntityResult(MetadataHelper.getClassForName(eResult.getEntityClass().getName(), loader));
       
            // Process the field results.
            if (eResult.hasFieldResults()) {
                for (FieldResultMetadata fResult : eResult.getFieldResults()) {
                    FieldResult fieldResult = new FieldResult(fResult.getName(), fResult.getColumn());
                    if (project.useDelimitedIdentifier()) {
                        fieldResult.getColumn().setUseDelimiters(true);
                    } else if (project.getShouldForceFieldNamesToUpperCase() && !fieldResult.getColumn().shouldUseDelimiters()) {
                        fieldResult.getColumn().useUpperCaseForComparisons(true);
                    }
                    entityResult.addFieldResult(fieldResult);
                }
            }
       
            // Process the discriminator value;
            if (eResult.getDiscriminatorColumn() !=null){
                DatabaseField descriminatorField = new DatabaseField(eResult.getDiscriminatorColumn());
                if (project.useDelimitedIdentifier()) {
                    descriminatorField.setUseDelimiters(true);
                } else if (project.getShouldForceFieldNamesToUpperCase() && !descriminatorField.shouldUseDelimiters()){
                    descriminatorField.useUpperCaseForComparisons(true);
                }
                entityResult.setDiscriminatorColumn(descriminatorField);
            }
       
            // Add the result to the SqlResultSetMapping.
            mapping.addResult(entityResult);
        }
       
        // Process the column results.
        for (String columnResult : m_columnResults) {
            ColumnResult result = new ColumnResult(columnResult);
            if (project.useDelimitedIdentifier()) {
                result.getColumn().setUseDelimiters(true);
            }
            if (project.getShouldForceFieldNamesToUpperCase()) {
                result.getColumn().useUpperCaseForComparisons(true);
            }
            mapping.addResult(result);
        }
           
        session.getProject().addSQLResultSetMapping(mapping);
    }
View Full Code Here

        // Clear old descriptors to allow rehash on new classes.
        this.descriptors = new HashMap();
        // convert class names to classes for each SQLResultSetMapping
        if (sqlResultSetMappings != null) {
            for (Iterator mappingIt = sqlResultSetMappings.keySet().iterator(); mappingIt.hasNext();) {
                SQLResultSetMapping mapping = (SQLResultSetMapping) sqlResultSetMappings.get(mappingIt.next());
                mapping.convertClassNamesToClasses(classLoader);
            }
        }
    }
View Full Code Here

        // Clear old descriptors to allow rehash on new classes.
        this.descriptors = new HashMap();
        // convert class names to classes for each SQLResultSetMapping
        if (sqlResultSetMappings != null) {
            for (Iterator mappingIt = sqlResultSetMappings.keySet().iterator(); mappingIt.hasNext();) {
                SQLResultSetMapping mapping = (SQLResultSetMapping) sqlResultSetMappings.get(mappingIt.next());
                mapping.convertClassNamesToClasses(classLoader);
            }
        }
    }
View Full Code Here

     * Process an sql result set mapping metadata into a EclipseLink
     * SqlResultSetMapping and store it on the session.
     */
    public void process(AbstractSession session, ClassLoader loader, MetadataProject project) {       
        // Initialize a new SqlResultSetMapping (with the metadata name)
        SQLResultSetMapping mapping = new SQLResultSetMapping(getName());
       
        // Process the entity results.
        for (EntityResultMetadata eResult : m_entityResults) {
            EntityResult entityResult = new EntityResult(MetadataHelper.getClassForName(eResult.getEntityClass().getName(), loader));
       
            // Process the field results.
            if (eResult.hasFieldResults()) {
                for (FieldResultMetadata fResult : eResult.getFieldResults()) {
                    FieldResult fieldResult = new FieldResult(fResult.getName(), fResult.getColumn());
                    if (project.useDelimitedIdentifier()) {
                        fieldResult.getColumn().setUseDelimiters(true);
                    } else if (project.getShouldForceFieldNamesToUpperCase() && !fieldResult.getColumn().shouldUseDelimiters()) {
                        //done directly as this field's name should be in uppercase.
                        fieldResult.getColumn().setName(fieldResult.getColumn().getName().toUpperCase());
                    }
                    entityResult.addFieldResult(fieldResult);
                }
            }
       
            // Process the discriminator value;
            if (eResult.getDiscriminatorColumn() !=null){
                DatabaseField descriminatorField = new DatabaseField(eResult.getDiscriminatorColumn());
                if (project.useDelimitedIdentifier()) {
                    descriminatorField.setUseDelimiters(true);
                } else if (project.getShouldForceFieldNamesToUpperCase() && !descriminatorField.shouldUseDelimiters()){
                    descriminatorField.setName(descriminatorField.getName().toUpperCase());
                }
                entityResult.setDiscriminatorColumn(descriminatorField);
            }
       
            // Add the result to the SqlResultSetMapping.
            mapping.addResult(entityResult);
        }
       
        // Process the column results.
        for (String columnResult : m_columnResults) {
            ColumnResult result = new ColumnResult(columnResult);
            if (project.useDelimitedIdentifier()) {
                result.getColumn().setUseDelimiters(true);
            }
            if (project.getShouldForceFieldNamesToUpperCase()) {
                result.getColumn().toUpperCase();
            }
            mapping.addResult(result);
        }
           
        session.getProject().addSQLResultSetMapping(mapping);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.queries.SQLResultSetMapping

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.