Search in sources :

Example 1 with SDOPropertyType

use of org.eclipse.persistence.sdo.types.SDOPropertyType in project eclipselink by eclipse-ee4j.

the class SDOXMLHelperDelegate method getTopLinkProject.

@Override
public Project getTopLinkProject() {
    if (topLinkProject == null) {
        topLinkProject = new Project();
        XMLLogin xmlLogin = new XMLLogin();
        xmlLogin.setEqualNamespaceResolvers(false);
        topLinkProject.setDatasourceLogin(xmlLogin);
        // 200606_changeSummary
        NamespaceResolver nr = new NamespaceResolver();
        SDOTypeHelper sdoTypeHelper = (SDOTypeHelper) aHelperContext.getTypeHelper();
        String sdoPrefix = sdoTypeHelper.getPrefix(SDOConstants.SDO_URL);
        nr.put(sdoPrefix, SDOConstants.SDO_URL);
        SDOType changeSummaryType = (SDOType) sdoTypeHelper.getType(SDOConstants.SDO_URL, SDOConstants.CHANGESUMMARY);
        changeSummaryType.getXmlDescriptor().setNamespaceResolver(nr);
        topLinkProject.addDescriptor(changeSummaryType.getXmlDescriptor());
        SDOType openSequencedType = (SDOType) aHelperContext.getTypeHelper().getType(SDOConstants.ORACLE_SDO_URL, "OpenSequencedType");
        topLinkProject.addDescriptor(openSequencedType.getXmlDescriptor());
        SDOTypeType typeType = (SDOTypeType) aHelperContext.getTypeHelper().getType(SDOConstants.SDO_URL, SDOConstants.TYPE);
        typeType.getXmlDescriptor().setNamespaceResolver(nr);
        if (!typeType.isInitialized()) {
            typeType.initializeMappings();
        }
        topLinkProject.addDescriptor(typeType.getXmlDescriptor());
        SDOPropertyType propertyType = (SDOPropertyType) aHelperContext.getTypeHelper().getType(SDOConstants.SDO_URL, SDOConstants.PROPERTY);
        if (!propertyType.isInitialized()) {
            propertyType.initializeMappings();
        }
        topLinkProject.addDescriptor(propertyType.getXmlDescriptor());
        ((SDOTypeHelper) aHelperContext.getTypeHelper()).addWrappersToProject(topLinkProject);
    }
    return topLinkProject;
}
Also used : Project(org.eclipse.persistence.sessions.Project) SDOTypeHelper(org.eclipse.persistence.sdo.helper.SDOTypeHelper) SDOTypeType(org.eclipse.persistence.sdo.types.SDOTypeType) XMLLogin(org.eclipse.persistence.oxm.XMLLogin) SDOType(org.eclipse.persistence.sdo.SDOType) NamespaceResolver(org.eclipse.persistence.oxm.NamespaceResolver) SDOPropertyType(org.eclipse.persistence.sdo.types.SDOPropertyType)

Example 2 with SDOPropertyType

use of org.eclipse.persistence.sdo.types.SDOPropertyType in project eclipselink by eclipse-ee4j.

the class SDOHelperTestCases method testUnwrapTypeToSDOPropertyType.

public void testUnwrapTypeToSDOPropertyType() {
    Type propertyType = typeHelper.getType(SDOConstants.SDO_URL, SDOConstants.PROPERTY);
    assertTrue(SDOHelper.unwrap(propertyType, SDOPropertyType.class) instanceof SDOPropertyType);
}
Also used : SDOChangeSummaryType(org.eclipse.persistence.sdo.types.SDOChangeSummaryType) SDOOpenSequencedType(org.eclipse.persistence.sdo.types.SDOOpenSequencedType) SDOXMLHelperLoadOptionsType(org.eclipse.persistence.sdo.types.SDOXMLHelperLoadOptionsType) SDOPropertyType(org.eclipse.persistence.sdo.types.SDOPropertyType) SDOObjectType(org.eclipse.persistence.sdo.types.SDOObjectType) SDOWrapperType(org.eclipse.persistence.sdo.types.SDOWrapperType) Type(commonj.sdo.Type) SDODataType(org.eclipse.persistence.sdo.types.SDODataType) SDODataObjectType(org.eclipse.persistence.sdo.types.SDODataObjectType) SDOTypeType(org.eclipse.persistence.sdo.types.SDOTypeType) SDOType(org.eclipse.persistence.sdo.SDOType) SDOPropertyType(org.eclipse.persistence.sdo.types.SDOPropertyType)

Aggregations

SDOType (org.eclipse.persistence.sdo.SDOType)2 SDOPropertyType (org.eclipse.persistence.sdo.types.SDOPropertyType)2 SDOTypeType (org.eclipse.persistence.sdo.types.SDOTypeType)2 Type (commonj.sdo.Type)1 NamespaceResolver (org.eclipse.persistence.oxm.NamespaceResolver)1 XMLLogin (org.eclipse.persistence.oxm.XMLLogin)1 SDOTypeHelper (org.eclipse.persistence.sdo.helper.SDOTypeHelper)1 SDOChangeSummaryType (org.eclipse.persistence.sdo.types.SDOChangeSummaryType)1 SDODataObjectType (org.eclipse.persistence.sdo.types.SDODataObjectType)1 SDODataType (org.eclipse.persistence.sdo.types.SDODataType)1 SDOObjectType (org.eclipse.persistence.sdo.types.SDOObjectType)1 SDOOpenSequencedType (org.eclipse.persistence.sdo.types.SDOOpenSequencedType)1 SDOWrapperType (org.eclipse.persistence.sdo.types.SDOWrapperType)1 SDOXMLHelperLoadOptionsType (org.eclipse.persistence.sdo.types.SDOXMLHelperLoadOptionsType)1 Project (org.eclipse.persistence.sessions.Project)1