@Override public ClassDescriptor buildDatabaseLoginDescriptor() { XMLDescriptor descriptor = (XMLDescriptor)super.buildDatabaseLoginDescriptor(); XMLDirectMapping shouldBindAllParametersMapping = (XMLDirectMapping)descriptor.getMappingForAttributeName("shouldBindAllParameters"); shouldBindAllParametersMapping.setNullValue(Boolean.TRUE); return descriptor; }
@Override public ClassDescriptor buildDatabaseLoginDescriptor() { XMLDescriptor descriptor = (XMLDescriptor)super.buildDatabaseLoginDescriptor(); XMLDirectMapping shouldBindAllParametersMapping = (XMLDirectMapping)descriptor.getMappingForAttributeName("shouldBindAllParameters"); shouldBindAllParametersMapping.setNullValue(Boolean.TRUE); return descriptor; }
@Override public ClassDescriptor buildDatabaseLoginDescriptor() { XMLDescriptor descriptor = (XMLDescriptor)super.buildDatabaseLoginDescriptor(); XMLDirectMapping shouldBindAllParametersMapping = (XMLDirectMapping)descriptor.getMappingForAttributeName("shouldBindAllParameters"); shouldBindAllParametersMapping.setNullValue(Boolean.TRUE); return descriptor; }
/** * INTERNAL: * @param type a type to become this Type's base Type. */ public void addBaseType(SDOType type) { if (!this.getBaseTypes().contains(type)) { getBaseTypes().add(type); updateSubtypes(type); if(!(type.isDataType() && (type.getQName().getNamespaceURI() == SDOConstants.SDO_URL || type.getQName().getNamespaceURI() == SDOConstants.SDOJAVA_URL))) { type.getSubTypes().add(this); } if (type.isOpen() && this.isOpen()) { //don't want any mappings on this descriptor DatabaseMapping anyCollectionMapping = getXmlDescriptor().getMappingForAttributeName(ANY_MAPPING_ATTRIBUTE_NAME); getXmlDescriptor().getMappings().remove(anyCollectionMapping); DatabaseMapping anyAttrMapping = getXmlDescriptor().getMappingForAttributeName("openContentPropertiesAttributes"); getXmlDescriptor().getMappings().remove(anyAttrMapping); } //int increaseBy = type.getProperties().size(); //increaseIndices(increaseBy); } }
/** * INTERNAL: * @param type a type to become this Type's base Type. */ public void addBaseType(SDOType type) { if (!this.getBaseTypes().contains(type)) { getBaseTypes().add(type); updateSubtypes(type); if(!(type.isDataType() && (type.getQName().getNamespaceURI() == SDOConstants.SDO_URL || type.getQName().getNamespaceURI() == SDOConstants.SDOJAVA_URL))) { type.getSubTypes().add(this); } if (type.isOpen() && this.isOpen()) { //don't want any mappings on this descriptor DatabaseMapping anyCollectionMapping = getXmlDescriptor().getMappingForAttributeName(ANY_MAPPING_ATTRIBUTE_NAME); getXmlDescriptor().getMappings().remove(anyCollectionMapping); DatabaseMapping anyAttrMapping = getXmlDescriptor().getMappingForAttributeName("openContentPropertiesAttributes"); getXmlDescriptor().getMappings().remove(anyAttrMapping); } //int increaseBy = type.getProperties().size(); //increaseIndices(increaseBy); } }
public void setMixed(boolean isMixed) { String textAttribute = "text"; XMLDirectMapping textMapping = (XMLDirectMapping) xmlDescriptor.getMappingForAttributeName(textAttribute); if (isMixed) { if (null == textMapping) { textMapping = new XMLDirectMapping(); textMapping.setAttributeName(textAttribute); textMapping.setXPath("text()"); xmlDescriptor.addMapping(textMapping); } } else { xmlDescriptor.removeMappingForAttributeName(textAttribute); } }
public void setMixed(boolean isMixed) { String textAttribute = "text"; XMLDirectMapping textMapping = (XMLDirectMapping) xmlDescriptor.getMappingForAttributeName(textAttribute); if (isMixed) { if (null == textMapping) { textMapping = new XMLDirectMapping(); textMapping.setAttributeName(textAttribute); textMapping.setXPath("text()"); xmlDescriptor.addMapping(textMapping); } } else { xmlDescriptor.removeMappingForAttributeName(textAttribute); } }
ClassDescriptor containingDescriptor = getContainingType().getXmlDescriptor(); xmlMapping.setDescriptor(containingDescriptor); XMLMapping mapping = (XMLMapping)getContainingType().getXmlDescriptor().getMappingForAttributeName(getName()); if (mapping != null) { getContainingType().getXmlDescriptor().getMappings().remove(mapping);
ClassDescriptor containingDescriptor = getContainingType().getXmlDescriptor(); xmlMapping.setDescriptor(containingDescriptor); XMLMapping mapping = (XMLMapping)getContainingType().getXmlDescriptor().getMappingForAttributeName(getName()); if (mapping != null) { getContainingType().getXmlDescriptor().getMappings().remove(mapping);
/** * INTERNAL: * Convenience method that sets up class indicator and @sdoRef * attribute. * * @param xdesc * @param pCls */ private void addClassIndicator(XMLDescriptor xdesc, Class pCls, boolean isInheritanceRoot) { XMLField field = (XMLField)getXmlDescriptor().buildField("@xsi:type"); field.initialize(); xdesc.getInheritancePolicy().setClassIndicatorField(field); String parentIndicator = getName(); String parentPrefix = xdesc.getNamespaceResolver().resolveNamespaceURI(getURI()); if (parentPrefix != null) { parentIndicator = parentPrefix + SDOConstants.SDO_XPATH_NS_SEPARATOR_FRAGMENT + parentIndicator; } xdesc.getInheritancePolicy().addClassIndicator(pCls, parentIndicator); // only add the @sdoRef attribute if necessary if (xdesc.getMappingForAttributeName(SDO_REF_MAPPING_ATTRIBUTE_NAME) == null) { String sdoPrefix = ((SDOTypeHelper)aHelperContext.getTypeHelper()).getPrefix(SDOConstants.SDO_URL); XMLDirectMapping sdoRefMapping = new XMLDirectMapping(); sdoRefMapping.setAttributeName(SDO_REF_MAPPING_ATTRIBUTE_NAME); XMLField xmlField = new XMLField("@" + sdoPrefix + SDOConstants.SDO_XPATH_NS_SEPARATOR_FRAGMENT + SDOConstants.CHANGESUMMARY_REF); xmlField.getXPathFragment().setNamespaceURI(SDOConstants.SDO_URL); xmlField.getLastXPathFragment().setNamespaceURI(SDOConstants.SDO_URL); sdoRefMapping.setField(xmlField); xdesc.addMapping(sdoRefMapping); } }
if (xdesc.getMappingForAttributeName(SDO_REF_MAPPING_ATTRIBUTE_NAME) == null) { String sdoPrefix = ((SDOTypeHelper)aHelperContext.getTypeHelper()).getPrefix(SDOConstants.SDO_URL); XMLDirectMapping sdoRefMapping = new XMLDirectMapping();
setting.setObject(dataObject); mapping = xmlDescriptor.getMappingForAttributeName("openContentProperties"); setting.setMapping(mapping); XMLRoot xmlRoot = new XMLRoot();
setting.setObject(dataObject); mapping = xmlDescriptor.getMappingForAttributeName("openContentProperties"); setting.setMapping(mapping); XMLRoot xmlRoot = new XMLRoot();