/** * INTERNAL: */ protected XMLDirectMapping getPreRemoveMapping() { XMLDirectMapping preRemoveMapping = new XMLDirectMapping(); preRemoveMapping.setAttributeName("m_preRemove"); preRemoveMapping.setGetMethodName("getPreRemove"); preRemoveMapping.setSetMethodName("setPreRemove"); preRemoveMapping.setXPath("orm:pre-remove/@method-name"); return preRemoveMapping; }
/** * INTERNAL: */ protected XMLDirectMapping getQueryMapping() { XMLDirectMapping queryMapping = new XMLDirectMapping(); queryMapping.setAttributeName("m_query"); queryMapping.setGetMethodName("getQuery"); queryMapping.setSetMethodName("setQuery"); queryMapping.setXPath("orm:query"); return queryMapping; }
/** * INTERNAL */ protected XMLDirectMapping getUniqueAttributeMapping() { XMLDirectMapping uniqueMapping = new XMLDirectMapping(); uniqueMapping.setAttributeName("m_unique"); uniqueMapping.setGetMethodName("getUnique"); uniqueMapping.setSetMethodName("setUnique"); uniqueMapping.setXPath("@unique"); return uniqueMapping; }
/** * INTERNAL: */ protected XMLDirectMapping getValueAttributeMapping() { XMLDirectMapping valueMapping = new XMLDirectMapping(); valueMapping.setAttributeName("m_value"); valueMapping.setGetMethodName("getValue"); valueMapping.setSetMethodName("setValue"); valueMapping.setXPath("@value"); return valueMapping; }
protected XMLDescriptor buildAttachmentDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(Attachment.class); XMLDirectMapping mimeType = new XMLDirectMapping(); mimeType.setAttributeName("mimeType"); mimeType.setXPath("mime-type/text()"); descriptor.addMapping(mimeType); return descriptor; }
public ClassDescriptor buildCommandsConfigDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(CommandsConfig.class); XMLDirectMapping cacheSyncMapping = new XMLDirectMapping(); cacheSyncMapping.setAttributeName("m_cacheSync"); cacheSyncMapping.setGetMethodName("getCacheSync"); cacheSyncMapping.setSetMethodName("setCacheSync"); cacheSyncMapping.setXPath("cache-sync/text()"); cacheSyncMapping.setNullValue(Boolean.valueOf(CACHE_SYNC_DEFAULT)); descriptor.addMapping(cacheSyncMapping); return descriptor; }
protected ClassDescriptor buildOXXMLDescriptorDescriptor() { ClassDescriptor descriptor = super.buildOXXMLDescriptorDescriptor(); XMLDirectMapping alwaysXMLRootMapping = new XMLDirectMapping(); alwaysXMLRootMapping.setAttributeName("resultAlwaysXMLRoot"); alwaysXMLRootMapping.setGetMethodName("isResultAlwaysXMLRoot"); alwaysXMLRootMapping.setSetMethodName("setResultAlwaysXMLRoot"); alwaysXMLRootMapping.setNullValue(Boolean.FALSE); alwaysXMLRootMapping.setXPath(getPrimaryNamespaceXPath() + "result-always-xml-root/text()"); descriptor.addMapping(alwaysXMLRootMapping); return descriptor; }
@Override protected ClassDescriptor buildXMLAnyCollectionMappingDescriptor() { XMLDescriptor descriptor = (XMLDescriptor) super.buildXMLAnyCollectionMappingDescriptor(); XMLDirectMapping reuseContainerMapping = new XMLDirectMapping(); reuseContainerMapping.setAttributeName("reuseContainer"); reuseContainerMapping.setGetMethodName("getReuseContainer"); reuseContainerMapping.setSetMethodName("setReuseContainer"); reuseContainerMapping.setXPath(getPrimaryNamespaceXPath() + "reuse-container/text()"); reuseContainerMapping.setNullValue(Boolean.FALSE); descriptor.addMapping(reuseContainerMapping); return descriptor; }
protected ClassDescriptor buildTimeToLiveCacheInvalidationPolicyDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(TimeToLiveCacheInvalidationPolicy.class); descriptor.getInheritancePolicy().setParentClass(CacheInvalidationPolicy.class); XMLDirectMapping timeToLiveMapping = new XMLDirectMapping(); timeToLiveMapping.setAttributeName("timeToLive"); timeToLiveMapping.setXPath(getPrimaryNamespaceXPath() + "time-to-live/text()"); descriptor.addMapping(timeToLiveMapping); return descriptor; }
@Override protected ClassDescriptor buildXMLChoiceCollectionMappingDescriptor() { XMLDescriptor descriptor = (XMLDescriptor) super.buildXMLChoiceCollectionMappingDescriptor(); XMLDirectMapping reuseContainerMapping = new XMLDirectMapping(); reuseContainerMapping.setAttributeName("reuseContainer"); reuseContainerMapping.setGetMethodName("getReuseContainer"); reuseContainerMapping.setSetMethodName("setReuseContainer"); reuseContainerMapping.setXPath(getPrimaryNamespaceXPath() + "reuse-container/text()"); reuseContainerMapping.setNullValue(Boolean.FALSE); descriptor.addMapping(reuseContainerMapping); return descriptor; }
protected ClassDescriptor buildDatabaseTableDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(DatabaseTable.class); descriptor.setDefaultRootElement("table"); XMLDirectMapping nameMapping = new XMLDirectMapping(); nameMapping.setAttributeName("name"); nameMapping.setGetMethodName("getQualifiedName"); nameMapping.setSetMethodName("setPossiblyQualifiedName"); nameMapping.setXPath("@name"); descriptor.addMapping(nameMapping); return descriptor; }
@Override protected ClassDescriptor buildXMLAnyObjectMappingDescriptor() { XMLDescriptor descriptor = (XMLDescriptor)super.buildXMLAnyObjectMappingDescriptor(); XMLDirectMapping xmlRootMapping = new XMLDirectMapping(); xmlRootMapping.setAttributeName("useXMLRoot"); xmlRootMapping.setGetMethodName("usesXMLRoot"); xmlRootMapping.setSetMethodName("setUseXMLRoot"); xmlRootMapping.setXPath(getPrimaryNamespaceXPath() + "use-xml-root/text()"); xmlRootMapping.setNullValue(Boolean.FALSE); descriptor.addMapping(xmlRootMapping); return descriptor; }
@Override protected ClassDescriptor buildXMLFieldDescriptor() { XMLDescriptor descriptor = (XMLDescriptor) super.buildXMLFieldDescriptor(); XMLDirectMapping isRequiredMapping = new XMLDirectMapping(); isRequiredMapping.setAttributeName("isRequired"); isRequiredMapping.setGetMethodName("isRequired"); isRequiredMapping.setSetMethodName("setRequired"); isRequiredMapping.setXPath(getPrimaryNamespaceXPath() + "@is-required"); isRequiredMapping.setNullValue(Boolean.FALSE); descriptor.addMapping(isRequiredMapping); return descriptor; }
protected ClassDescriptor buildNullPolicyDescriptor() { XMLDescriptor aDescriptor = new XMLDescriptor(); aDescriptor.setJavaClass(NullPolicy.class); aDescriptor.getInheritancePolicy().setParentClass(AbstractNullPolicy.class); // This boolean can only be set on the NullPolicy implementation even though the field is on the abstract class XMLDirectMapping xnranMapping = new XMLDirectMapping(); xnranMapping.setAttributeName("isSetPerformedForAbsentNode"); xnranMapping.setXPath(getPrimaryNamespaceXPath() + "is-set-performed-for-absent-node/text()"); xnranMapping.setNullValue(Boolean.TRUE); aDescriptor.addMapping(xnranMapping); return aDescriptor; }
protected ClassDescriptor buildXMLListConverterDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(XMLListConverter.class); descriptor.getInheritancePolicy().setParentClass(Converter.class); XMLDirectMapping fieldSubElementClassNameMapping = new XMLDirectMapping(); fieldSubElementClassNameMapping.setAttributeName("objectClassName"); fieldSubElementClassNameMapping.setGetMethodName("getObjectClassName"); fieldSubElementClassNameMapping.setSetMethodName("setObjectClassName"); fieldSubElementClassNameMapping.setXPath(getPrimaryNamespaceXPath() + "object-class-name"); descriptor.addMapping(fieldSubElementClassNameMapping); return descriptor; }
protected ClassDescriptor buildAggregateMappingDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(AggregateMapping.class); descriptor.getInheritancePolicy().setParentClass(DatabaseMapping.class); XMLDirectMapping referenceClassMapping = new XMLDirectMapping(); referenceClassMapping.setAttributeName("referenceClass"); referenceClassMapping.setGetMethodName("getReferenceClass"); referenceClassMapping.setSetMethodName("setReferenceClass"); referenceClassMapping.setXPath(getPrimaryNamespaceXPath() + "reference-class/text()"); descriptor.addMapping(referenceClassMapping); return descriptor; }
protected ClassDescriptor buildArrayMappingDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(ArrayMapping.class); descriptor.getInheritancePolicy().setParentClass(AbstractCompositeDirectCollectionMapping.class); XMLDirectMapping structureMapping = new XMLDirectMapping(); structureMapping.setAttributeName("structureName"); structureMapping.setGetMethodName("getStructureName"); structureMapping.setSetMethodName("setStructureName"); structureMapping.setXPath(getPrimaryNamespaceXPath() + "structure/text()"); descriptor.addMapping(structureMapping); return descriptor; }
protected ClassDescriptor buildInterfaceContainerPolicyDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(InterfaceContainerPolicy.class); descriptor.getInheritancePolicy().setParentClass(ContainerPolicy.class); XMLDirectMapping keyMapping = new XMLDirectMapping(); keyMapping.setAttributeName("containerClass"); keyMapping.setGetMethodName("getContainerClass"); keyMapping.setSetMethodName("setContainerClass"); keyMapping.setXPath(getPrimaryNamespaceXPath() + "collection-type/text()"); descriptor.addMapping(keyMapping); return descriptor; }
protected ClassDescriptor buildMapContainerPolicyDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(MapContainerPolicy.class); descriptor.getInheritancePolicy().setParentClass(InterfaceContainerPolicy.class); XMLDirectMapping keyMapping = new XMLDirectMapping(); keyMapping.setAttributeName("keyName"); keyMapping.setGetMethodName("getKeyName"); keyMapping.setSetMethodName("setKeyName"); keyMapping.setXPath(getPrimaryNamespaceXPath() + "map-key-method/text()"); descriptor.addMapping(keyMapping); return descriptor; }
protected ClassDescriptor buildTransformerBasedFieldTransformationDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(TransformerBasedFieldTransformation.class); descriptor.getInheritancePolicy().setParentClass(FieldTransformation.class); XMLDirectMapping methodNameMapping = new XMLDirectMapping(); methodNameMapping.setAttributeName("transformerClass"); methodNameMapping.setXPath(getPrimaryNamespaceXPath() + "transformer-class/text()"); methodNameMapping.setGetMethodName("getTransformerClass"); methodNameMapping.setSetMethodName("setTransformerClass"); descriptor.addMapping(methodNameMapping); return descriptor; }