本文整理了Java中org.eclipse.persistence.oxm.mappings.XMLDirectMapping.setNullPolicy()
方法的一些代码示例,展示了XMLDirectMapping.setNullPolicy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLDirectMapping.setNullPolicy()
方法的具体详情如下:
包路径:org.eclipse.persistence.oxm.mappings.XMLDirectMapping
类名称:XMLDirectMapping
方法名:setNullPolicy
[英]Set the AbstractNullPolicy on the mapping
The default policy is NullPolicy.
[中]在映射上设置AbstractNullPolicy
默认策略为NullPolicy。
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
*/
protected XMLDirectMapping getExcludeSuperclassListenersMapping() {
XMLDirectMapping excludeSuperclassListenersMapping = new XMLDirectMapping();
excludeSuperclassListenersMapping.setAttributeName("m_excludeSuperclassListeners");
excludeSuperclassListenersMapping.setGetMethodName("getExcludeSuperclassListeners");
excludeSuperclassListenersMapping.setSetMethodName("setExcludeSuperclassListeners");
excludeSuperclassListenersMapping.setConverter(new EmptyElementConverter());
IsSetNullPolicy excludeSuperclassListenersPolicy = new IsSetNullPolicy("excludeSuperclassListeners");
excludeSuperclassListenersPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
excludeSuperclassListenersMapping.setNullPolicy(excludeSuperclassListenersPolicy);
excludeSuperclassListenersMapping.setXPath("orm:exclude-superclass-listeners");
return excludeSuperclassListenersMapping;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
*/
protected XMLDirectMapping getReturnUpdateMapping() {
XMLDirectMapping mapping = new XMLDirectMapping();
mapping.setAttributeName("m_returnUpdate");
mapping.setGetMethodName("getReturnUpdate");
mapping.setSetMethodName("setReturnUpdate");
mapping.setConverter(new EmptyElementConverter());
IsSetNullPolicy returnUpdatePolicy = new IsSetNullPolicy("isReturnUpdate");
returnUpdatePolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
mapping.setNullPolicy(returnUpdatePolicy);
mapping.setXPath("orm:return-update");
return mapping;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
*/
protected XMLDirectMapping getExcludeDefaultListenersMapping() {
XMLDirectMapping excludeDefaultListenersMapping = new XMLDirectMapping();
excludeDefaultListenersMapping.setAttributeName("m_excludeDefaultListeners");
excludeDefaultListenersMapping.setGetMethodName("getExcludeDefaultListeners");
excludeDefaultListenersMapping.setSetMethodName("setExcludeDefaultListeners");
excludeDefaultListenersMapping.setConverter(new EmptyElementConverter());
IsSetNullPolicy excludeDefaultListenersPolicy = new IsSetNullPolicy("excludeDefaultListeners");
excludeDefaultListenersPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
excludeDefaultListenersMapping.setNullPolicy(excludeDefaultListenersPolicy);
excludeDefaultListenersMapping.setXPath("orm:exclude-default-listeners");
return excludeDefaultListenersMapping;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
*/
protected XMLDirectMapping getPrivateOwnedMapping() {
XMLDirectMapping privateOwnedMapping = new XMLDirectMapping();
privateOwnedMapping.setAttributeName("m_privateOwned");
privateOwnedMapping.setGetMethodName("getPrivateOwned");
privateOwnedMapping.setSetMethodName("setPrivateOwned");
privateOwnedMapping.setConverter(new EmptyElementConverter());
IsSetNullPolicy privateOwnedPolicy = new IsSetNullPolicy("isPrivateOwned");
privateOwnedPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
privateOwnedMapping.setNullPolicy(privateOwnedPolicy);
privateOwnedMapping.setXPath("orm:private-owned");
return privateOwnedMapping;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
*/
protected XMLDirectMapping getDeleteAllMapping() {
XMLDirectMapping deleteAllMapping = new XMLDirectMapping();
deleteAllMapping.setAttributeName("m_deleteAll");
deleteAllMapping.setGetMethodName("getDeleteAll");
deleteAllMapping.setSetMethodName("setDeleteAll");
deleteAllMapping.setXPath("orm:delete-all");
deleteAllMapping.setConverter(new EmptyElementConverter());
IsSetNullPolicy deleteAllPolicy = new IsSetNullPolicy("isDeleteAll");
deleteAllPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
deleteAllMapping.setNullPolicy(deleteAllPolicy);
return deleteAllMapping;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
*/
protected XMLDirectMapping getNonCacheableMapping() {
XMLDirectMapping noncacheable = new XMLDirectMapping();
noncacheable.setAttributeName("m_nonCacheable");
noncacheable.setGetMethodName("getNonCacheable");
noncacheable.setSetMethodName("setNonCacheable");
noncacheable.setConverter(new EmptyElementConverter());
IsSetNullPolicy cacheablePolicy = new IsSetNullPolicy("isNonCacheable");
cacheablePolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
noncacheable.setNullPolicy(cacheablePolicy);
noncacheable.setXPath("orm:noncacheable");
return noncacheable;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
*/
protected XMLDirectMapping getCascadePersistMapping() {
XMLDirectMapping cascadePersistMapping = new XMLDirectMapping();
cascadePersistMapping.setAttributeName("m_cascadePersist");
cascadePersistMapping.setGetMethodName("getCascadePersist");
cascadePersistMapping.setSetMethodName("setCascadePersist");
//cascadePersistMapping.setAttributeClassification(String.class);
cascadePersistMapping.setConverter(new EmptyElementConverter());
IsSetNullPolicy cascadePersistPolicy = new IsSetNullPolicy("isCascadePersist");
cascadePersistPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
cascadePersistMapping.setNullPolicy(cascadePersistPolicy);
cascadePersistMapping.setXPath("orm:cascade-persist");
return cascadePersistMapping;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
validateConnectionHealthOnErrorMapping.setSetMethodName("setConnectionHealthValidatedOnError");
validateConnectionHealthOnErrorMapping.setXPath("connection-health-validated-on-error/text()");
validateConnectionHealthOnErrorMapping.setNullPolicy(new NullPolicy(null, false, false, false));
validateConnectionHealthOnErrorMapping.setNullValue(true);
descriptor.addMapping(validateConnectionHealthOnErrorMapping);
delayBetweenReconnectAttempts.setSetMethodName("setDelayBetweenConnectionAttempts");
delayBetweenReconnectAttempts.setXPath("delay-between-reconnect-attempts/text()");
delayBetweenReconnectAttempts.setNullPolicy(new NullPolicy(null, false, false, false));
descriptor.addMapping(delayBetweenReconnectAttempts);
queryRetryAttemptCount.setSetMethodName("setQueryRetryAttemptCount");
queryRetryAttemptCount.setXPath("query-retry-attempt-count/text()");
queryRetryAttemptCount.setNullPolicy(new NullPolicy(null, false, false, false));
descriptor.addMapping(queryRetryAttemptCount);
pingSQLMapping.setSetMethodName("setPingSQL");
pingSQLMapping.setXPath("ping-sql/text()");
pingSQLMapping.setNullPolicy(new NullPolicy(null, false, false, false));
descriptor.addMapping(pingSQLMapping);
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
validateConnectionHealthOnErrorMapping.setSetMethodName("setConnectionHealthValidatedOnError");
validateConnectionHealthOnErrorMapping.setXPath("connection-health-validated-on-error/text()");
validateConnectionHealthOnErrorMapping.setNullPolicy(new NullPolicy(null, false, false, false));
validateConnectionHealthOnErrorMapping.setNullValue(true);
descriptor.addMapping(validateConnectionHealthOnErrorMapping);
delayBetweenReconnectAttempts.setSetMethodName("setDelayBetweenConnectionAttempts");
delayBetweenReconnectAttempts.setXPath("delay-between-reconnect-attempts/text()");
delayBetweenReconnectAttempts.setNullPolicy(new NullPolicy(null, false, false, false));
descriptor.addMapping(delayBetweenReconnectAttempts);
queryRetryAttemptCount.setSetMethodName("setQueryRetryAttemptCount");
queryRetryAttemptCount.setXPath("query-retry-attempt-count/text()");
queryRetryAttemptCount.setNullPolicy(new NullPolicy(null, false, false, false));
descriptor.addMapping(queryRetryAttemptCount);
pingSQLMapping.setSetMethodName("setPingSQL");
pingSQLMapping.setXPath("ping-sql/text()");
pingSQLMapping.setNullPolicy(new NullPolicy(null, false, false, false));
descriptor.addMapping(pingSQLMapping);
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
validateConnectionHealthOnErrorMapping.setSetMethodName("setConnectionHealthValidatedOnError");
validateConnectionHealthOnErrorMapping.setXPath("connection-health-validated-on-error/text()");
validateConnectionHealthOnErrorMapping.setNullPolicy(new NullPolicy(null, false, false, false));
validateConnectionHealthOnErrorMapping.setNullValue(true);
descriptor.addMapping(validateConnectionHealthOnErrorMapping);
delayBetweenReconnectAttempts.setSetMethodName("setDelayBetweenConnectionAttempts");
delayBetweenReconnectAttempts.setXPath("delay-between-reconnect-attempts/text()");
delayBetweenReconnectAttempts.setNullPolicy(new NullPolicy(null, false, false, false));
descriptor.addMapping(delayBetweenReconnectAttempts);
queryRetryAttemptCount.setSetMethodName("setQueryRetryAttemptCount");
queryRetryAttemptCount.setXPath("query-retry-attempt-count/text()");
queryRetryAttemptCount.setNullPolicy(new NullPolicy(null, false, false, false));
descriptor.addMapping(queryRetryAttemptCount);
pingSQLMapping.setSetMethodName("setPingSQL");
pingSQLMapping.setXPath("ping-sql/text()");
pingSQLMapping.setNullPolicy(new NullPolicy(null, false, false, false));
descriptor.addMapping(pingSQLMapping);
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
@Override
protected ClassDescriptor buildDatabaseFieldDescriptor() {
XMLDescriptor descriptor = (XMLDescriptor)super.buildDatabaseFieldDescriptor();
XMLDirectMapping sqlTypeMapping = new XMLDirectMapping();
sqlTypeMapping.setAttributeName("sqlType");
sqlTypeMapping.setGetMethodName("getSqlType");
sqlTypeMapping.setSetMethodName("setSqlType");
sqlTypeMapping.setXPath(getPrimaryNamespaceXPath() + "@sql-typecode");
sqlTypeMapping.setNullValue(Integer.valueOf(NULL_SQL_TYPE));
NullPolicy nullPolicy = new NullPolicy();
nullPolicy.setNullRepresentedByEmptyNode(false);
nullPolicy.setNullRepresentedByXsiNil(false);
nullPolicy.setSetPerformedForAbsentNode(false);
nullPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.ABSENT_NODE);
sqlTypeMapping.setNullPolicy(nullPolicy);
//NULL_SQL_TYPE
descriptor.addMapping(sqlTypeMapping);
XMLDirectMapping colDefMapping = new XMLDirectMapping();
colDefMapping.setAttributeName("columnDefinition");
colDefMapping.setGetMethodName("getColumnDefinition");
colDefMapping.setSetMethodName("setColumnDefinition");
colDefMapping.setXPath(getPrimaryNamespaceXPath() + "@column-definition");
colDefMapping.setNullValue("");
colDefMapping.setNullPolicy(nullPolicy);
//NULL_SQL_TYPE
descriptor.addMapping(colDefMapping);
return descriptor;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
@Override
protected ClassDescriptor buildDatabaseFieldDescriptor() {
XMLDescriptor descriptor = (XMLDescriptor)super.buildDatabaseFieldDescriptor();
XMLDirectMapping sqlTypeMapping = new XMLDirectMapping();
sqlTypeMapping.setAttributeName("sqlType");
sqlTypeMapping.setGetMethodName("getSqlType");
sqlTypeMapping.setSetMethodName("setSqlType");
sqlTypeMapping.setXPath(getPrimaryNamespaceXPath() + "@sql-typecode");
sqlTypeMapping.setNullValue(Integer.valueOf(NULL_SQL_TYPE));
NullPolicy nullPolicy = new NullPolicy();
nullPolicy.setNullRepresentedByEmptyNode(false);
nullPolicy.setNullRepresentedByXsiNil(false);
nullPolicy.setSetPerformedForAbsentNode(false);
nullPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.ABSENT_NODE);
sqlTypeMapping.setNullPolicy(nullPolicy);
//NULL_SQL_TYPE
descriptor.addMapping(sqlTypeMapping);
XMLDirectMapping colDefMapping = new XMLDirectMapping();
colDefMapping.setAttributeName("columnDefinition");
colDefMapping.setGetMethodName("getColumnDefinition");
colDefMapping.setSetMethodName("setColumnDefinition");
colDefMapping.setXPath(getPrimaryNamespaceXPath() + "@column-definition");
colDefMapping.setNullValue("");
colDefMapping.setNullPolicy(nullPolicy);
//NULL_SQL_TYPE
descriptor.addMapping(colDefMapping);
return descriptor;
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
@Override
protected ClassDescriptor buildDatabaseFieldDescriptor() {
XMLDescriptor descriptor = (XMLDescriptor)super.buildDatabaseFieldDescriptor();
XMLDirectMapping sqlTypeMapping = new XMLDirectMapping();
sqlTypeMapping.setAttributeName("sqlType");
sqlTypeMapping.setGetMethodName("getSqlType");
sqlTypeMapping.setSetMethodName("setSqlType");
sqlTypeMapping.setXPath(getPrimaryNamespaceXPath() + "@sql-typecode");
sqlTypeMapping.setNullValue(Integer.valueOf(NULL_SQL_TYPE));
NullPolicy nullPolicy = new NullPolicy();
nullPolicy.setNullRepresentedByEmptyNode(false);
nullPolicy.setNullRepresentedByXsiNil(false);
nullPolicy.setSetPerformedForAbsentNode(false);
nullPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.ABSENT_NODE);
sqlTypeMapping.setNullPolicy(nullPolicy);
//NULL_SQL_TYPE
descriptor.addMapping(sqlTypeMapping);
XMLDirectMapping colDefMapping = new XMLDirectMapping();
colDefMapping.setAttributeName("columnDefinition");
colDefMapping.setGetMethodName("getColumnDefinition");
colDefMapping.setSetMethodName("setColumnDefinition");
colDefMapping.setXPath(getPrimaryNamespaceXPath() + "@column-definition");
colDefMapping.setNullValue("");
colDefMapping.setNullPolicy(nullPolicy);
//NULL_SQL_TYPE
descriptor.addMapping(colDefMapping);
return descriptor;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
IsSetNullPolicy cascadeAllPolicy = new IsSetNullPolicy("isCascadeAll");
cascadeAllPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
cascadeAllMapping.setNullPolicy(cascadeAllPolicy);
cascadeAllMapping.setXPath("orm:cascade-all");
descriptor.addMapping(cascadeAllMapping);
IsSetNullPolicy cascadeMergePolicy = new IsSetNullPolicy("isCascadeMerge");
cascadeMergePolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
cascadeMergeMapping.setNullPolicy(cascadeMergePolicy);
cascadeMergeMapping.setXPath("orm:cascade-merge");
descriptor.addMapping(cascadeMergeMapping);
IsSetNullPolicy cascadeRemovePolicy = new IsSetNullPolicy("isCascadeRemove");
cascadeRemovePolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
cascadeRemoveMapping.setNullPolicy(cascadeRemovePolicy);
cascadeRemoveMapping.setXPath("orm:cascade-remove");
descriptor.addMapping(cascadeRemoveMapping);
IsSetNullPolicy cascadeRefreshPolicy = new IsSetNullPolicy("isCascadeRefresh");
cascadeRefreshPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
cascadeRefreshMapping.setNullPolicy(cascadeRefreshPolicy);
cascadeRefreshMapping.setXPath("orm:cascade-refresh");
descriptor.addMapping(cascadeRefreshMapping);
IsSetNullPolicy cascadeDetachPolicy = new IsSetNullPolicy("isCascadeDetach");
cascadeDetachPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
cascadeDetachMapping.setNullPolicy(cascadeDetachPolicy);
cascadeDetachMapping.setXPath("orm:cascade-detach");
descriptor.addMapping(cascadeDetachMapping);
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
IsSetNullPolicy xmlMappingMetadataCompletePolicy = new IsSetNullPolicy("isXMLMappingMetadataComplete");
xmlMappingMetadataCompletePolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
xmlMappingMetadataCompleteMapping.setNullPolicy(xmlMappingMetadataCompletePolicy);
xmlMappingMetadataCompleteMapping.setXPath("orm:xml-mapping-metadata-complete");
descriptor.addMapping(xmlMappingMetadataCompleteMapping);
IsSetNullPolicy excludeDefaultMappingsPolicy = new IsSetNullPolicy("excludeDefaultMappings");
excludeDefaultMappingsPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
excludeDefaultMappingsMapping.setNullPolicy(excludeDefaultMappingsPolicy);
excludeDefaultMappingsMapping.setXPath("orm:exclude-default-mappings");
descriptor.addMapping(excludeDefaultMappingsMapping);
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
* XSD: persistence-unit-defaults
*/
protected ClassDescriptor buildPersistenceUnitDefaultsDescriptor() {
XMLDescriptor descriptor = new XMLDescriptor();
descriptor.setJavaClass(XMLPersistenceUnitDefaults.class);
// Element mappings - must remain in order of definition in XML.
descriptor.addMapping(getSchemaMapping());
descriptor.addMapping(getCatalogMapping());
XMLDirectMapping delimitedIdentifiersMapping = new XMLDirectMapping();
delimitedIdentifiersMapping.setAttributeName("m_delimitedIdentifiers");
delimitedIdentifiersMapping.setGetMethodName("getDelimitedIdentifiers");
delimitedIdentifiersMapping.setSetMethodName("setDelimitedIdentifiers");
delimitedIdentifiersMapping.setConverter(new EmptyElementConverter());
IsSetNullPolicy delimitedIdentifiersPolicy = new IsSetNullPolicy("isDelimitedIdentifiers");
delimitedIdentifiersPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
delimitedIdentifiersMapping.setNullPolicy(delimitedIdentifiersPolicy);
delimitedIdentifiersMapping.setXPath("orm:delimited-identifiers");
descriptor.addMapping(delimitedIdentifiersMapping);
descriptor.addMapping(getAccessMapping());
descriptor.addMapping(getAccessMethodsMapping());
descriptor.addMapping(getCascadePersistMapping());
descriptor.addMapping(getTenantDiscriminatorColumnsMapping());
descriptor.addMapping(getEntityListenersMapping());
return descriptor;
}
内容来源于网络,如有侵权,请联系作者删除!