Package org.eclipse.persistence.oxm.schema

Examples of org.eclipse.persistence.oxm.schema.XMLSchemaClassPathReference


    }

    @Override
    protected ClassDescriptor buildProjectDescriptor() {
        XMLDescriptor descriptor = (XMLDescriptor)super.buildProjectDescriptor();
        descriptor.setSchemaReference(new XMLSchemaClassPathReference(SCHEMA_DIR + TOPLINK_11_SCHEMA));

        XMLDirectMapping defaultTemporalMutableMapping = new XMLDirectMapping();
        defaultTemporalMutableMapping.setAttributeName("defaultTemporalMutable");
        defaultTemporalMutableMapping.setSetMethodName("setDefaultTemporalMutable");
        defaultTemporalMutableMapping.setGetMethodName("getDefaultTemporalMutable");
View Full Code Here


    public ClassDescriptor buildSessionConfigsDescriptor() {
        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setDefaultRootElement("sessions");
        descriptor.setJavaClass(SessionConfigs.class);
        descriptor.setSchemaReference(new XMLSchemaClassPathReference(ECLIPSELINK_SESSIONS_SCHEMA));

        XMLDirectMapping versionMapping = new XMLDirectMapping();
        versionMapping.setAttributeName("m_version");
        versionMapping.setGetMethodName("getVersion");
        versionMapping.setSetMethodName("setVersion");
View Full Code Here

     */
    protected ClassDescriptor buildEntityMappingsDescriptor(String xsdLocation) {
        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setDefaultRootElement("orm:entity-mappings");
        descriptor.setJavaClass(XMLEntityMappings.class);
        descriptor.setSchemaReference(new XMLSchemaClassPathReference(xsdLocation));
       
        descriptor.addMapping(getDescriptionMapping());
       
        XMLCompositeObjectMapping persistenceUnitMetadataMapping = new XMLCompositeObjectMapping();
        persistenceUnitMetadataMapping.setAttributeName("m_persistenceUnitMetadata");
View Full Code Here

    protected ClassDescriptor buildProjectDescriptor() {
        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setJavaClass(Project.class);
        descriptor.setDefaultRootElement(getPrimaryNamespaceXPath() + "object-persistence");

        descriptor.setSchemaReference(new XMLSchemaClassPathReference(SCHEMA_DIR + TOPLINK_10_SCHEMA));

        XMLTransformationMapping versionMapping = new XMLTransformationMapping();
        versionMapping.addFieldTransformer("@version", getConstantTransformerForProjectVersionMapping());
        descriptor.addMapping(versionMapping);
View Full Code Here

        descriptor.getInheritancePolicy().setClassIndicatorField(new XMLField("@xsi:type"));
        descriptor.getInheritancePolicy().addClassIndicator(DatabaseField.class, getSecondaryNamespaceXPath() + "column");
        descriptor.getInheritancePolicy().addClassIndicator(XMLField.class, getPrimaryNamespaceXPath() + "node");
        descriptor.getInheritancePolicy().addClassIndicator(XMLUnionField.class, getPrimaryNamespaceXPath() + "union-node");

        XMLSchemaReference reference = new XMLSchemaClassPathReference();
        reference.setSchemaContext("/"+ getSecondaryNamespaceXPath() + "column");
        descriptor.setSchemaReference(reference);
       
        XMLDirectMapping tableMapping = new XMLDirectMapping();
        tableMapping.setAttributeName("table");
        tableMapping.setGetMethodName("getTableName");
View Full Code Here

    }

    @Override
    protected ClassDescriptor buildProjectDescriptor() {
        XMLDescriptor descriptor = (XMLDescriptor)super.buildProjectDescriptor();
        descriptor.setSchemaReference(new XMLSchemaClassPathReference(SCHEMA_DIR + ECLIPSELINK_SCHEMA));

        XMLCompositeCollectionMapping projectQueriesMapping = new XMLCompositeCollectionMapping();
        projectQueriesMapping.useCollectionClass(NonSynchronizedVector.class);
        projectQueriesMapping.setAttributeName("queries");
        projectQueriesMapping.setSetMethodName("setQueries");
View Full Code Here

    public ClassDescriptor buildSessionConfigsDescriptor() {
        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setDefaultRootElement("sessions");
        descriptor.setJavaClass(SessionConfigs.class);
        descriptor.setSchemaReference(new XMLSchemaClassPathReference(ECLIPSELINK_SESSIONS_SCHEMA));

        XMLDirectMapping versionMapping = new XMLDirectMapping();
        versionMapping.setAttributeName("m_version");
        versionMapping.setGetMethodName("getVersion");
        versionMapping.setSetMethodName("setVersion");
View Full Code Here

     */
    protected ClassDescriptor buildEntityMappingsDescriptor(String xsdLocation) {
        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setDefaultRootElement("orm:entity-mappings");
        descriptor.setJavaClass(XMLEntityMappings.class);
        descriptor.setSchemaReference(new XMLSchemaClassPathReference(xsdLocation));
       
        descriptor.addMapping(getDescriptionMapping());
       
        XMLCompositeObjectMapping persistenceUnitMetadataMapping = new XMLCompositeObjectMapping();
        persistenceUnitMetadataMapping.setAttributeName("m_persistenceUnitMetadata");
View Full Code Here

        project.addDescriptor(xmlDescriptor);
        info.setDescriptor(xmlDescriptor);
    }
   
    private void setSchemaContext(XMLDescriptor desc, TypeInfo info) {
        XMLSchemaClassPathReference schemaRef = new XMLSchemaClassPathReference();
        if (info.getClassNamespace() == null || info.getClassNamespace().equals("")) {
            schemaRef.setSchemaContext("/" + info.getSchemaTypeName());
        } else {
            String prefix = desc.getNonNullNamespaceResolver().resolveNamespaceURI(info.getClassNamespace());
            if (prefix != null && !prefix.equals("")) {
                schemaRef.setSchemaContext("/" + prefix + ":" + info.getSchemaTypeName());
            } else {
              String generatedPrefix =getPrefixForNamespace(info.getClassNamespace(), desc.getNonNullNamespaceResolver(), null);
              schemaRef.setSchemaContext("/" + getQualifiedString(generatedPrefix, info.getSchemaTypeName()));
            }
            schemaRef.setSchemaContextAsQName(new QName(info.getClassNamespace(), info.getSchemaTypeName()));
        }
        // the default type is complex; need to check for simple type case
        if (info.isEnumerationType() || (info.getPropertyNames().size() == 1 && helper.isAnnotationPresent(info.getProperties().get(info.getPropertyNames().get(0)).getElement(), XmlValue.class))) {
            schemaRef.setType(XMLSchemaReference.SIMPLE_TYPE);
        }
        desc.setSchemaReference(schemaRef);

    }
View Full Code Here

                schemaContext = prefix + SDOConstants.SDO_XPATH_NS_SEPARATOR_FRAGMENT + schemaContext;
            }
        }
        String schemaContextWithSlash = SDOConstants.SDO_XPATH_SEPARATOR_FRAGMENT + schemaContext;

        XMLSchemaReference schemaRef = new XMLSchemaClassPathReference();
        schemaRef.setSchemaContext(schemaContextWithSlash);
        schemaRef.setType(XMLSchemaReference.COMPLEX_TYPE);
        getXmlDescriptor().setSchemaReference(schemaRef);

    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.oxm.schema.XMLSchemaClassPathReference

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.