Search in sources :

Example 1 with ProjectXMLConfig

use of org.eclipse.persistence.internal.sessions.factories.model.project.ProjectXMLConfig in project eclipselink by eclipse-ee4j.

the class DBWSBuilder method buildOXProjectConfig.

protected ProjectConfig buildOXProjectConfig() {
    ProjectConfig oxProjectConfig = null;
    boolean useProjectXML = false;
    if (builderHelper.hasTables() || hasBuildSqlOperations()) {
        useProjectXML = true;
    }
    if (!useProjectXML) {
        // check for any named queries - SimpleXMLFormatProject's sometimes need them
        if (orProject.getQueries().size() > 0) {
            useProjectXML = true;
        } else // check for ObjectRelationalDataTypeDescriptor's - Advanced JDBC object/varray types
        if (orProject.getDescriptors().size() > 0) {
            Collection<ClassDescriptor> descriptors = orProject.getDescriptors().values();
            for (ClassDescriptor desc : descriptors) {
                if (desc.isObjectRelationalDataTypeDescriptor()) {
                    useProjectXML = true;
                    break;
                }
            }
        }
    }
    if (useProjectXML) {
        oxProjectConfig = new ProjectXMLConfig();
        String pathPrefix = packager.getOxProjectPathPrefix();
        oxProjectConfig.setProjectString(pathPrefix == null ? DBWS_OX_XML : pathPrefix + DBWS_OX_XML);
    } else {
        oxProjectConfig = new ProjectClassConfig();
        oxProjectConfig.setProjectString(SimpleXMLFormatProject.class.getName());
    }
    return oxProjectConfig;
}
Also used : ProjectConfig(org.eclipse.persistence.internal.sessions.factories.model.project.ProjectConfig) SimpleXMLFormatProject(org.eclipse.persistence.internal.xr.sxf.SimpleXMLFormatProject) ProjectXMLConfig(org.eclipse.persistence.internal.sessions.factories.model.project.ProjectXMLConfig) ClassDescriptor(org.eclipse.persistence.descriptors.ClassDescriptor) Collection(java.util.Collection) ProjectClassConfig(org.eclipse.persistence.internal.sessions.factories.model.project.ProjectClassConfig)

Example 2 with ProjectXMLConfig

use of org.eclipse.persistence.internal.sessions.factories.model.project.ProjectXMLConfig in project eclipselink by eclipse-ee4j.

the class DBWSBuilder method buildORProjectConfig.

protected ProjectConfig buildORProjectConfig() {
    ProjectConfig orProjectConfig = null;
    boolean useProjectXML = false;
    if (builderHelper.hasTables() || hasBuildSqlOperations()) {
        useProjectXML = true;
    }
    if (!useProjectXML) {
        // check for any named queries - SimpleXMLFormatProject's sometimes need them
        if (orProject.getQueries().size() > 0) {
            useProjectXML = true;
        } else // check for ObjectRelationalDataTypeDescriptor's - Advanced JDBC object/varray types
        if (orProject.getDescriptors().size() > 0) {
            Collection<ClassDescriptor> descriptors = orProject.getDescriptors().values();
            for (ClassDescriptor desc : descriptors) {
                if (desc.isObjectRelationalDataTypeDescriptor()) {
                    useProjectXML = true;
                    break;
                }
            }
        }
    }
    if (useProjectXML) {
        orProjectConfig = new ProjectXMLConfig();
        String pathPrefix = packager.getOrProjectPathPrefix();
        orProjectConfig.setProjectString(pathPrefix == null ? DBWS_OR_XML : pathPrefix + DBWS_OR_XML);
    } else {
        orProjectConfig = new ProjectClassConfig();
        orProjectConfig.setProjectString(Project.class.getName());
    }
    return orProjectConfig;
}
Also used : ProjectConfig(org.eclipse.persistence.internal.sessions.factories.model.project.ProjectConfig) SimpleXMLFormatProject(org.eclipse.persistence.internal.xr.sxf.SimpleXMLFormatProject) Project(org.eclipse.persistence.sessions.Project) ProjectXMLConfig(org.eclipse.persistence.internal.sessions.factories.model.project.ProjectXMLConfig) ClassDescriptor(org.eclipse.persistence.descriptors.ClassDescriptor) Collection(java.util.Collection) ProjectClassConfig(org.eclipse.persistence.internal.sessions.factories.model.project.ProjectClassConfig)

Aggregations

Collection (java.util.Collection)2 ClassDescriptor (org.eclipse.persistence.descriptors.ClassDescriptor)2 ProjectClassConfig (org.eclipse.persistence.internal.sessions.factories.model.project.ProjectClassConfig)2 ProjectConfig (org.eclipse.persistence.internal.sessions.factories.model.project.ProjectConfig)2 ProjectXMLConfig (org.eclipse.persistence.internal.sessions.factories.model.project.ProjectXMLConfig)2 SimpleXMLFormatProject (org.eclipse.persistence.internal.xr.sxf.SimpleXMLFormatProject)2 Project (org.eclipse.persistence.sessions.Project)1