org.eclipse.persistence.oxm.mappings.XMLDirectMapping.setNullPolicy()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(18.0k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中org.eclipse.persistence.oxm.mappings.XMLDirectMapping.setNullPolicy()方法的一些代码示例,展示了XMLDirectMapping.setNullPolicy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLDirectMapping.setNullPolicy()方法的具体详情如下:
包路径:org.eclipse.persistence.oxm.mappings.XMLDirectMapping
类名称:XMLDirectMapping
方法名:setNullPolicy

XMLDirectMapping.setNullPolicy介绍

[英]Set the AbstractNullPolicy on the mapping
The default policy is NullPolicy.
[中]在映射上设置AbstractNullPolicy
默认策略为NullPolicy。

代码示例

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. */
  4. protected XMLDirectMapping getExcludeSuperclassListenersMapping() {
  5. XMLDirectMapping excludeSuperclassListenersMapping = new XMLDirectMapping();
  6. excludeSuperclassListenersMapping.setAttributeName("m_excludeSuperclassListeners");
  7. excludeSuperclassListenersMapping.setGetMethodName("getExcludeSuperclassListeners");
  8. excludeSuperclassListenersMapping.setSetMethodName("setExcludeSuperclassListeners");
  9. excludeSuperclassListenersMapping.setConverter(new EmptyElementConverter());
  10. IsSetNullPolicy excludeSuperclassListenersPolicy = new IsSetNullPolicy("excludeSuperclassListeners");
  11. excludeSuperclassListenersPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  12. excludeSuperclassListenersMapping.setNullPolicy(excludeSuperclassListenersPolicy);
  13. excludeSuperclassListenersMapping.setXPath("orm:exclude-superclass-listeners");
  14. return excludeSuperclassListenersMapping;
  15. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. */
  4. protected XMLDirectMapping getReturnUpdateMapping() {
  5. XMLDirectMapping mapping = new XMLDirectMapping();
  6. mapping.setAttributeName("m_returnUpdate");
  7. mapping.setGetMethodName("getReturnUpdate");
  8. mapping.setSetMethodName("setReturnUpdate");
  9. mapping.setConverter(new EmptyElementConverter());
  10. IsSetNullPolicy returnUpdatePolicy = new IsSetNullPolicy("isReturnUpdate");
  11. returnUpdatePolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  12. mapping.setNullPolicy(returnUpdatePolicy);
  13. mapping.setXPath("orm:return-update");
  14. return mapping;
  15. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. */
  4. protected XMLDirectMapping getExcludeDefaultListenersMapping() {
  5. XMLDirectMapping excludeDefaultListenersMapping = new XMLDirectMapping();
  6. excludeDefaultListenersMapping.setAttributeName("m_excludeDefaultListeners");
  7. excludeDefaultListenersMapping.setGetMethodName("getExcludeDefaultListeners");
  8. excludeDefaultListenersMapping.setSetMethodName("setExcludeDefaultListeners");
  9. excludeDefaultListenersMapping.setConverter(new EmptyElementConverter());
  10. IsSetNullPolicy excludeDefaultListenersPolicy = new IsSetNullPolicy("excludeDefaultListeners");
  11. excludeDefaultListenersPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  12. excludeDefaultListenersMapping.setNullPolicy(excludeDefaultListenersPolicy);
  13. excludeDefaultListenersMapping.setXPath("orm:exclude-default-listeners");
  14. return excludeDefaultListenersMapping;
  15. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. */
  4. protected XMLDirectMapping getPrivateOwnedMapping() {
  5. XMLDirectMapping privateOwnedMapping = new XMLDirectMapping();
  6. privateOwnedMapping.setAttributeName("m_privateOwned");
  7. privateOwnedMapping.setGetMethodName("getPrivateOwned");
  8. privateOwnedMapping.setSetMethodName("setPrivateOwned");
  9. privateOwnedMapping.setConverter(new EmptyElementConverter());
  10. IsSetNullPolicy privateOwnedPolicy = new IsSetNullPolicy("isPrivateOwned");
  11. privateOwnedPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  12. privateOwnedMapping.setNullPolicy(privateOwnedPolicy);
  13. privateOwnedMapping.setXPath("orm:private-owned");
  14. return privateOwnedMapping;
  15. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. */
  4. protected XMLDirectMapping getDeleteAllMapping() {
  5. XMLDirectMapping deleteAllMapping = new XMLDirectMapping();
  6. deleteAllMapping.setAttributeName("m_deleteAll");
  7. deleteAllMapping.setGetMethodName("getDeleteAll");
  8. deleteAllMapping.setSetMethodName("setDeleteAll");
  9. deleteAllMapping.setXPath("orm:delete-all");
  10. deleteAllMapping.setConverter(new EmptyElementConverter());
  11. IsSetNullPolicy deleteAllPolicy = new IsSetNullPolicy("isDeleteAll");
  12. deleteAllPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  13. deleteAllMapping.setNullPolicy(deleteAllPolicy);
  14. return deleteAllMapping;
  15. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. */
  4. protected XMLDirectMapping getNonCacheableMapping() {
  5. XMLDirectMapping noncacheable = new XMLDirectMapping();
  6. noncacheable.setAttributeName("m_nonCacheable");
  7. noncacheable.setGetMethodName("getNonCacheable");
  8. noncacheable.setSetMethodName("setNonCacheable");
  9. noncacheable.setConverter(new EmptyElementConverter());
  10. IsSetNullPolicy cacheablePolicy = new IsSetNullPolicy("isNonCacheable");
  11. cacheablePolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  12. noncacheable.setNullPolicy(cacheablePolicy);
  13. noncacheable.setXPath("orm:noncacheable");
  14. return noncacheable;
  15. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. */
  4. protected XMLDirectMapping getCascadePersistMapping() {
  5. XMLDirectMapping cascadePersistMapping = new XMLDirectMapping();
  6. cascadePersistMapping.setAttributeName("m_cascadePersist");
  7. cascadePersistMapping.setGetMethodName("getCascadePersist");
  8. cascadePersistMapping.setSetMethodName("setCascadePersist");
  9. //cascadePersistMapping.setAttributeClassification(String.class);
  10. cascadePersistMapping.setConverter(new EmptyElementConverter());
  11. IsSetNullPolicy cascadePersistPolicy = new IsSetNullPolicy("isCascadePersist");
  12. cascadePersistPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  13. cascadePersistMapping.setNullPolicy(cascadePersistPolicy);
  14. cascadePersistMapping.setXPath("orm:cascade-persist");
  15. return cascadePersistMapping;
  16. }

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. validateConnectionHealthOnErrorMapping.setSetMethodName("setConnectionHealthValidatedOnError");
  2. validateConnectionHealthOnErrorMapping.setXPath("connection-health-validated-on-error/text()");
  3. validateConnectionHealthOnErrorMapping.setNullPolicy(new NullPolicy(null, false, false, false));
  4. validateConnectionHealthOnErrorMapping.setNullValue(true);
  5. descriptor.addMapping(validateConnectionHealthOnErrorMapping);
  6. delayBetweenReconnectAttempts.setSetMethodName("setDelayBetweenConnectionAttempts");
  7. delayBetweenReconnectAttempts.setXPath("delay-between-reconnect-attempts/text()");
  8. delayBetweenReconnectAttempts.setNullPolicy(new NullPolicy(null, false, false, false));
  9. descriptor.addMapping(delayBetweenReconnectAttempts);
  10. queryRetryAttemptCount.setSetMethodName("setQueryRetryAttemptCount");
  11. queryRetryAttemptCount.setXPath("query-retry-attempt-count/text()");
  12. queryRetryAttemptCount.setNullPolicy(new NullPolicy(null, false, false, false));
  13. descriptor.addMapping(queryRetryAttemptCount);
  14. pingSQLMapping.setSetMethodName("setPingSQL");
  15. pingSQLMapping.setXPath("ping-sql/text()");
  16. pingSQLMapping.setNullPolicy(new NullPolicy(null, false, false, false));
  17. descriptor.addMapping(pingSQLMapping);

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. validateConnectionHealthOnErrorMapping.setSetMethodName("setConnectionHealthValidatedOnError");
  2. validateConnectionHealthOnErrorMapping.setXPath("connection-health-validated-on-error/text()");
  3. validateConnectionHealthOnErrorMapping.setNullPolicy(new NullPolicy(null, false, false, false));
  4. validateConnectionHealthOnErrorMapping.setNullValue(true);
  5. descriptor.addMapping(validateConnectionHealthOnErrorMapping);
  6. delayBetweenReconnectAttempts.setSetMethodName("setDelayBetweenConnectionAttempts");
  7. delayBetweenReconnectAttempts.setXPath("delay-between-reconnect-attempts/text()");
  8. delayBetweenReconnectAttempts.setNullPolicy(new NullPolicy(null, false, false, false));
  9. descriptor.addMapping(delayBetweenReconnectAttempts);
  10. queryRetryAttemptCount.setSetMethodName("setQueryRetryAttemptCount");
  11. queryRetryAttemptCount.setXPath("query-retry-attempt-count/text()");
  12. queryRetryAttemptCount.setNullPolicy(new NullPolicy(null, false, false, false));
  13. descriptor.addMapping(queryRetryAttemptCount);
  14. pingSQLMapping.setSetMethodName("setPingSQL");
  15. pingSQLMapping.setXPath("ping-sql/text()");
  16. pingSQLMapping.setNullPolicy(new NullPolicy(null, false, false, false));
  17. descriptor.addMapping(pingSQLMapping);

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  1. validateConnectionHealthOnErrorMapping.setSetMethodName("setConnectionHealthValidatedOnError");
  2. validateConnectionHealthOnErrorMapping.setXPath("connection-health-validated-on-error/text()");
  3. validateConnectionHealthOnErrorMapping.setNullPolicy(new NullPolicy(null, false, false, false));
  4. validateConnectionHealthOnErrorMapping.setNullValue(true);
  5. descriptor.addMapping(validateConnectionHealthOnErrorMapping);
  6. delayBetweenReconnectAttempts.setSetMethodName("setDelayBetweenConnectionAttempts");
  7. delayBetweenReconnectAttempts.setXPath("delay-between-reconnect-attempts/text()");
  8. delayBetweenReconnectAttempts.setNullPolicy(new NullPolicy(null, false, false, false));
  9. descriptor.addMapping(delayBetweenReconnectAttempts);
  10. queryRetryAttemptCount.setSetMethodName("setQueryRetryAttemptCount");
  11. queryRetryAttemptCount.setXPath("query-retry-attempt-count/text()");
  12. queryRetryAttemptCount.setNullPolicy(new NullPolicy(null, false, false, false));
  13. descriptor.addMapping(queryRetryAttemptCount);
  14. pingSQLMapping.setSetMethodName("setPingSQL");
  15. pingSQLMapping.setXPath("ping-sql/text()");
  16. pingSQLMapping.setNullPolicy(new NullPolicy(null, false, false, false));
  17. descriptor.addMapping(pingSQLMapping);

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. @Override
  2. protected ClassDescriptor buildDatabaseFieldDescriptor() {
  3. XMLDescriptor descriptor = (XMLDescriptor)super.buildDatabaseFieldDescriptor();
  4. XMLDirectMapping sqlTypeMapping = new XMLDirectMapping();
  5. sqlTypeMapping.setAttributeName("sqlType");
  6. sqlTypeMapping.setGetMethodName("getSqlType");
  7. sqlTypeMapping.setSetMethodName("setSqlType");
  8. sqlTypeMapping.setXPath(getPrimaryNamespaceXPath() + "@sql-typecode");
  9. sqlTypeMapping.setNullValue(Integer.valueOf(NULL_SQL_TYPE));
  10. NullPolicy nullPolicy = new NullPolicy();
  11. nullPolicy.setNullRepresentedByEmptyNode(false);
  12. nullPolicy.setNullRepresentedByXsiNil(false);
  13. nullPolicy.setSetPerformedForAbsentNode(false);
  14. nullPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.ABSENT_NODE);
  15. sqlTypeMapping.setNullPolicy(nullPolicy);
  16. //NULL_SQL_TYPE
  17. descriptor.addMapping(sqlTypeMapping);
  18. XMLDirectMapping colDefMapping = new XMLDirectMapping();
  19. colDefMapping.setAttributeName("columnDefinition");
  20. colDefMapping.setGetMethodName("getColumnDefinition");
  21. colDefMapping.setSetMethodName("setColumnDefinition");
  22. colDefMapping.setXPath(getPrimaryNamespaceXPath() + "@column-definition");
  23. colDefMapping.setNullValue("");
  24. colDefMapping.setNullPolicy(nullPolicy);
  25. //NULL_SQL_TYPE
  26. descriptor.addMapping(colDefMapping);
  27. return descriptor;
  28. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. @Override
  2. protected ClassDescriptor buildDatabaseFieldDescriptor() {
  3. XMLDescriptor descriptor = (XMLDescriptor)super.buildDatabaseFieldDescriptor();
  4. XMLDirectMapping sqlTypeMapping = new XMLDirectMapping();
  5. sqlTypeMapping.setAttributeName("sqlType");
  6. sqlTypeMapping.setGetMethodName("getSqlType");
  7. sqlTypeMapping.setSetMethodName("setSqlType");
  8. sqlTypeMapping.setXPath(getPrimaryNamespaceXPath() + "@sql-typecode");
  9. sqlTypeMapping.setNullValue(Integer.valueOf(NULL_SQL_TYPE));
  10. NullPolicy nullPolicy = new NullPolicy();
  11. nullPolicy.setNullRepresentedByEmptyNode(false);
  12. nullPolicy.setNullRepresentedByXsiNil(false);
  13. nullPolicy.setSetPerformedForAbsentNode(false);
  14. nullPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.ABSENT_NODE);
  15. sqlTypeMapping.setNullPolicy(nullPolicy);
  16. //NULL_SQL_TYPE
  17. descriptor.addMapping(sqlTypeMapping);
  18. XMLDirectMapping colDefMapping = new XMLDirectMapping();
  19. colDefMapping.setAttributeName("columnDefinition");
  20. colDefMapping.setGetMethodName("getColumnDefinition");
  21. colDefMapping.setSetMethodName("setColumnDefinition");
  22. colDefMapping.setXPath(getPrimaryNamespaceXPath() + "@column-definition");
  23. colDefMapping.setNullValue("");
  24. colDefMapping.setNullPolicy(nullPolicy);
  25. //NULL_SQL_TYPE
  26. descriptor.addMapping(colDefMapping);
  27. return descriptor;
  28. }

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  1. @Override
  2. protected ClassDescriptor buildDatabaseFieldDescriptor() {
  3. XMLDescriptor descriptor = (XMLDescriptor)super.buildDatabaseFieldDescriptor();
  4. XMLDirectMapping sqlTypeMapping = new XMLDirectMapping();
  5. sqlTypeMapping.setAttributeName("sqlType");
  6. sqlTypeMapping.setGetMethodName("getSqlType");
  7. sqlTypeMapping.setSetMethodName("setSqlType");
  8. sqlTypeMapping.setXPath(getPrimaryNamespaceXPath() + "@sql-typecode");
  9. sqlTypeMapping.setNullValue(Integer.valueOf(NULL_SQL_TYPE));
  10. NullPolicy nullPolicy = new NullPolicy();
  11. nullPolicy.setNullRepresentedByEmptyNode(false);
  12. nullPolicy.setNullRepresentedByXsiNil(false);
  13. nullPolicy.setSetPerformedForAbsentNode(false);
  14. nullPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.ABSENT_NODE);
  15. sqlTypeMapping.setNullPolicy(nullPolicy);
  16. //NULL_SQL_TYPE
  17. descriptor.addMapping(sqlTypeMapping);
  18. XMLDirectMapping colDefMapping = new XMLDirectMapping();
  19. colDefMapping.setAttributeName("columnDefinition");
  20. colDefMapping.setGetMethodName("getColumnDefinition");
  21. colDefMapping.setSetMethodName("setColumnDefinition");
  22. colDefMapping.setXPath(getPrimaryNamespaceXPath() + "@column-definition");
  23. colDefMapping.setNullValue("");
  24. colDefMapping.setNullPolicy(nullPolicy);
  25. //NULL_SQL_TYPE
  26. descriptor.addMapping(colDefMapping);
  27. return descriptor;
  28. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. IsSetNullPolicy cascadeAllPolicy = new IsSetNullPolicy("isCascadeAll");
  2. cascadeAllPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  3. cascadeAllMapping.setNullPolicy(cascadeAllPolicy);
  4. cascadeAllMapping.setXPath("orm:cascade-all");
  5. descriptor.addMapping(cascadeAllMapping);
  6. IsSetNullPolicy cascadeMergePolicy = new IsSetNullPolicy("isCascadeMerge");
  7. cascadeMergePolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  8. cascadeMergeMapping.setNullPolicy(cascadeMergePolicy);
  9. cascadeMergeMapping.setXPath("orm:cascade-merge");
  10. descriptor.addMapping(cascadeMergeMapping);
  11. IsSetNullPolicy cascadeRemovePolicy = new IsSetNullPolicy("isCascadeRemove");
  12. cascadeRemovePolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  13. cascadeRemoveMapping.setNullPolicy(cascadeRemovePolicy);
  14. cascadeRemoveMapping.setXPath("orm:cascade-remove");
  15. descriptor.addMapping(cascadeRemoveMapping);
  16. IsSetNullPolicy cascadeRefreshPolicy = new IsSetNullPolicy("isCascadeRefresh");
  17. cascadeRefreshPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  18. cascadeRefreshMapping.setNullPolicy(cascadeRefreshPolicy);
  19. cascadeRefreshMapping.setXPath("orm:cascade-refresh");
  20. descriptor.addMapping(cascadeRefreshMapping);
  21. IsSetNullPolicy cascadeDetachPolicy = new IsSetNullPolicy("isCascadeDetach");
  22. cascadeDetachPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  23. cascadeDetachMapping.setNullPolicy(cascadeDetachPolicy);
  24. cascadeDetachMapping.setXPath("orm:cascade-detach");
  25. descriptor.addMapping(cascadeDetachMapping);

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. IsSetNullPolicy xmlMappingMetadataCompletePolicy = new IsSetNullPolicy("isXMLMappingMetadataComplete");
  2. xmlMappingMetadataCompletePolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  3. xmlMappingMetadataCompleteMapping.setNullPolicy(xmlMappingMetadataCompletePolicy);
  4. xmlMappingMetadataCompleteMapping.setXPath("orm:xml-mapping-metadata-complete");
  5. descriptor.addMapping(xmlMappingMetadataCompleteMapping);
  6. IsSetNullPolicy excludeDefaultMappingsPolicy = new IsSetNullPolicy("excludeDefaultMappings");
  7. excludeDefaultMappingsPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  8. excludeDefaultMappingsMapping.setNullPolicy(excludeDefaultMappingsPolicy);
  9. excludeDefaultMappingsMapping.setXPath("orm:exclude-default-mappings");
  10. descriptor.addMapping(excludeDefaultMappingsMapping);

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. * XSD: persistence-unit-defaults
  4. */
  5. protected ClassDescriptor buildPersistenceUnitDefaultsDescriptor() {
  6. XMLDescriptor descriptor = new XMLDescriptor();
  7. descriptor.setJavaClass(XMLPersistenceUnitDefaults.class);
  8. // Element mappings - must remain in order of definition in XML.
  9. descriptor.addMapping(getSchemaMapping());
  10. descriptor.addMapping(getCatalogMapping());
  11. XMLDirectMapping delimitedIdentifiersMapping = new XMLDirectMapping();
  12. delimitedIdentifiersMapping.setAttributeName("m_delimitedIdentifiers");
  13. delimitedIdentifiersMapping.setGetMethodName("getDelimitedIdentifiers");
  14. delimitedIdentifiersMapping.setSetMethodName("setDelimitedIdentifiers");
  15. delimitedIdentifiersMapping.setConverter(new EmptyElementConverter());
  16. IsSetNullPolicy delimitedIdentifiersPolicy = new IsSetNullPolicy("isDelimitedIdentifiers");
  17. delimitedIdentifiersPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.EMPTY_NODE);
  18. delimitedIdentifiersMapping.setNullPolicy(delimitedIdentifiersPolicy);
  19. delimitedIdentifiersMapping.setXPath("orm:delimited-identifiers");
  20. descriptor.addMapping(delimitedIdentifiersMapping);
  21. descriptor.addMapping(getAccessMapping());
  22. descriptor.addMapping(getAccessMethodsMapping());
  23. descriptor.addMapping(getCascadePersistMapping());
  24. descriptor.addMapping(getTenantDiscriminatorColumnsMapping());
  25. descriptor.addMapping(getEntityListenersMapping());
  26. return descriptor;
  27. }

相关文章