本文整理了Java中org.eclipse.persistence.oxm.mappings.XMLDirectMapping.setXPath()
方法的一些代码示例,展示了XMLDirectMapping.setXPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLDirectMapping.setXPath()
方法的具体详情如下:
包路径:org.eclipse.persistence.oxm.mappings.XMLDirectMapping
类名称:XMLDirectMapping
方法名:setXPath
[英]Set the Mapping field name attribute to the given XPath String
[中]将映射字段名属性设置为给定的XPath字符串
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* 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;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
*/
protected XMLDirectMapping getQueryMapping() {
XMLDirectMapping queryMapping = new XMLDirectMapping();
queryMapping.setAttributeName("m_query");
queryMapping.setGetMethodName("getQuery");
queryMapping.setSetMethodName("setQuery");
queryMapping.setXPath("orm:query");
return queryMapping;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL
*/
protected XMLDirectMapping getUniqueAttributeMapping() {
XMLDirectMapping uniqueMapping = new XMLDirectMapping();
uniqueMapping.setAttributeName("m_unique");
uniqueMapping.setGetMethodName("getUnique");
uniqueMapping.setSetMethodName("setUnique");
uniqueMapping.setXPath("@unique");
return uniqueMapping;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
*/
protected XMLDirectMapping getValueAttributeMapping() {
XMLDirectMapping valueMapping = new XMLDirectMapping();
valueMapping.setAttributeName("m_value");
valueMapping.setGetMethodName("getValue");
valueMapping.setSetMethodName("setValue");
valueMapping.setXPath("@value");
return valueMapping;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
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;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
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;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
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;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
@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;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
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;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
@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;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
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;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
@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;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
@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;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
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;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
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;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
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;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
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;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
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;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
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;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
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;
}
内容来源于网络,如有侵权,请联系作者删除!