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

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

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

XMLDirectMapping.setConverter介绍

暂无

代码示例

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

@Override
protected ClassDescriptor buildDirectCollectionMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor)super.buildDirectCollectionMappingDescriptor();
  XMLDirectMapping joinFetchMapping = new XMLDirectMapping();
  joinFetchMapping.setAttributeName("joinFetch");
  joinFetchMapping.setXPath(getPrimaryNamespaceXPath() + "join-fetch/text()");
  ObjectTypeConverter joinFetchConverter = new ObjectTypeConverter();
  joinFetchConverter.addConversionValue("inner-join", Integer.valueOf(ForeignReferenceMapping.INNER_JOIN));
  joinFetchConverter.addConversionValue("outer-join", Integer.valueOf(ForeignReferenceMapping.OUTER_JOIN));
  joinFetchConverter.addConversionValue("none", Integer.valueOf(ForeignReferenceMapping.NONE));
  joinFetchMapping.setConverter(joinFetchConverter);
  joinFetchMapping.setNullValue(ForeignReferenceMapping.NONE);
  descriptor.addMapping(joinFetchMapping);
  return descriptor;
}

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

@Override
protected ClassDescriptor buildDirectCollectionMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor)super.buildDirectCollectionMappingDescriptor();
  XMLDirectMapping joinFetchMapping = new XMLDirectMapping();
  joinFetchMapping.setAttributeName("joinFetch");
  joinFetchMapping.setXPath(getPrimaryNamespaceXPath() + "join-fetch/text()");
  ObjectTypeConverter joinFetchConverter = new ObjectTypeConverter();
  joinFetchConverter.addConversionValue("inner-join", new Integer(ForeignReferenceMapping.INNER_JOIN));
  joinFetchConverter.addConversionValue("outer-join", new Integer(ForeignReferenceMapping.OUTER_JOIN));
  joinFetchConverter.addConversionValue("none", new Integer(ForeignReferenceMapping.NONE));
  joinFetchMapping.setConverter(joinFetchConverter);
  joinFetchMapping.setNullValue(ForeignReferenceMapping.NONE);
  descriptor.addMapping(joinFetchMapping);
  return descriptor;
}

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

@Override
protected ClassDescriptor buildOneToManyMappingMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor)super.buildOneToManyMappingMappingDescriptor();
  XMLDirectMapping joinFetchMapping = new XMLDirectMapping();
  joinFetchMapping.setAttributeName("joinFetch");
  joinFetchMapping.setXPath(getPrimaryNamespaceXPath() + "join-fetch/text()");
  ObjectTypeConverter joinFetchConverter = new ObjectTypeConverter();
  joinFetchConverter.addConversionValue("inner-join", Integer.valueOf(ForeignReferenceMapping.INNER_JOIN));
  joinFetchConverter.addConversionValue("outer-join", Integer.valueOf(ForeignReferenceMapping.OUTER_JOIN));
  joinFetchConverter.addConversionValue("none", Integer.valueOf(ForeignReferenceMapping.NONE));
  joinFetchMapping.setConverter(joinFetchConverter);
  joinFetchMapping.setNullValue(ForeignReferenceMapping.NONE);
  descriptor.addMapping(joinFetchMapping);
  return descriptor;
}

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

@Override
protected ClassDescriptor buildManyToManyMappingMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor)super.buildManyToManyMappingMappingDescriptor();
  XMLDirectMapping joinFetchMapping = new XMLDirectMapping();
  joinFetchMapping.setAttributeName("joinFetch");
  joinFetchMapping.setXPath(getPrimaryNamespaceXPath() + "join-fetch/text()");
  ObjectTypeConverter joinFetchConverter = new ObjectTypeConverter();
  joinFetchConverter.addConversionValue("inner-join", Integer.valueOf(ForeignReferenceMapping.INNER_JOIN));
  joinFetchConverter.addConversionValue("outer-join", Integer.valueOf(ForeignReferenceMapping.OUTER_JOIN));
  joinFetchConverter.addConversionValue("none", Integer.valueOf(ForeignReferenceMapping.NONE));
  joinFetchMapping.setConverter(joinFetchConverter);
  joinFetchMapping.setNullValue(ForeignReferenceMapping.NONE);
  descriptor.addMapping(joinFetchMapping);
  return descriptor;
}

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

@Override
protected ClassDescriptor buildOneToOneMappingDescriptor() {
  XMLDescriptor descriptor = (XMLDescriptor)super.buildOneToOneMappingDescriptor();
  descriptor.removeMappingForAttributeName("joinFetch");
  XMLDirectMapping joinFetchMapping = new XMLDirectMapping();
  joinFetchMapping.setAttributeName("joinFetch");
  joinFetchMapping.setXPath(getPrimaryNamespaceXPath() + "join-fetch/text()");
  ObjectTypeConverter joinFetchConverter = new ObjectTypeConverter();
  joinFetchConverter.addConversionValue("inner-join", new Integer(ForeignReferenceMapping.INNER_JOIN));
  joinFetchConverter.addConversionValue("outer-join", new Integer(ForeignReferenceMapping.OUTER_JOIN));
  joinFetchConverter.addConversionValue("none", new Integer(ForeignReferenceMapping.NONE));
  joinFetchMapping.setConverter(joinFetchConverter);
  joinFetchMapping.setNullValue(ForeignReferenceMapping.NONE);
  descriptor.addMapping(joinFetchMapping);
  return descriptor;
}

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

protected ClassDescriptor buildPessimisticLockingPolicyDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(PessimisticLockingPolicy.class);
  descriptor.setDefaultRootElement("pessimistic-locking-policy");
  XMLDirectMapping lockingModeMapping = new XMLDirectMapping();
  lockingModeMapping.setXPath(getPrimaryNamespaceXPath() + "locking-mode/text()");
  lockingModeMapping.setAttributeName("lockingMode");
  lockingModeMapping.setGetMethodName("getLockingMode");
  lockingModeMapping.setSetMethodName("setLockingMode");
  ObjectTypeConverter lockingModeConverter = new ObjectTypeConverter();
  lockingModeConverter.addConversionValue("wait", Short.valueOf(ObjectLevelReadQuery.LOCK));
  lockingModeConverter.addConversionValue("no-wait", Short.valueOf(ObjectLevelReadQuery.LOCK_NOWAIT));
  lockingModeMapping.setConverter(lockingModeConverter);
  descriptor.addMapping(lockingModeMapping);
  return descriptor;
}

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

protected ClassDescriptor buildPessimisticLockingPolicyDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(PessimisticLockingPolicy.class);
  descriptor.setDefaultRootElement("pessimistic-locking-policy");
  XMLDirectMapping lockingModeMapping = new XMLDirectMapping();
  lockingModeMapping.setXPath(getPrimaryNamespaceXPath() + "locking-mode/text()");
  lockingModeMapping.setAttributeName("lockingMode");
  lockingModeMapping.setGetMethodName("getLockingMode");
  lockingModeMapping.setSetMethodName("setLockingMode");
  ObjectTypeConverter lockingModeConverter = new ObjectTypeConverter();
  lockingModeConverter.addConversionValue("wait", Short.valueOf(ObjectLevelReadQuery.LOCK));
  lockingModeConverter.addConversionValue("no-wait", Short.valueOf(ObjectLevelReadQuery.LOCK_NOWAIT));
  lockingModeMapping.setConverter(lockingModeConverter);
  descriptor.addMapping(lockingModeMapping);
  return descriptor;
}

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

protected ClassDescriptor buildXMLAnyObjectMappingDescriptor() {
  ClassDescriptor descriptor = super.buildXMLAnyObjectMappingDescriptor();
  XMLDirectMapping keepAsElementMapping = new XMLDirectMapping();
  keepAsElementMapping.setAttributeName("keepAsElementPolicy");
  keepAsElementMapping.setGetMethodName("getKeepAsElementPolicy");
  keepAsElementMapping.setSetMethodName("setKeepAsElementPolicy");
  keepAsElementMapping.setXPath(getPrimaryNamespaceXPath() + "keep-as-element-policy");
  EnumTypeConverter converter = new EnumTypeConverter(keepAsElementMapping, UnmarshalKeepAsElementPolicy.class, false);
  keepAsElementMapping.setConverter(converter);
  descriptor.addMapping(keepAsElementMapping);
  return descriptor;
}

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

protected ClassDescriptor buildXMLAnyObjectMappingDescriptor() {
  ClassDescriptor descriptor = super.buildXMLAnyObjectMappingDescriptor();
  XMLDirectMapping keepAsElementMapping = new XMLDirectMapping();
  keepAsElementMapping.setAttributeName("keepAsElementPolicy");
  keepAsElementMapping.setGetMethodName("getKeepAsElementPolicy");
  keepAsElementMapping.setSetMethodName("setKeepAsElementPolicy");
  keepAsElementMapping.setXPath(getPrimaryNamespaceXPath() + "keep-as-element-policy");
  EnumTypeConverter converter = new EnumTypeConverter(keepAsElementMapping, UnmarshalKeepAsElementPolicy.class, false);
  keepAsElementMapping.setConverter(converter);
  descriptor.addMapping(keepAsElementMapping);
  return descriptor;
}

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

protected ClassDescriptor buildJDBCTypeWrapperDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(JDBCTypeWrapper.class);
  descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class);
  XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping();
  wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType");
  wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME);
  EnumTypeConverter jdbcTypesEnumTypeConverter = new EnumTypeConverter(
    wrappedDatabaseTypeMapping, JDBCTypes.class, false);
  wrappedDatabaseTypeMapping.setConverter(jdbcTypesEnumTypeConverter);
  descriptor.addMapping(wrappedDatabaseTypeMapping);
  return descriptor;
}

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

protected ClassDescriptor buildSimplePLSQLTypeWrapperDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(SimplePLSQLTypeWrapper.class);
  descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class);
  XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping();
  wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType");
  wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME);
  EnumTypeConverter oraclePLSQLTypesEnumTypeConverter = new EnumTypeConverter(
    wrappedDatabaseTypeMapping, OraclePLSQLTypes.class, false);
  wrappedDatabaseTypeMapping.setConverter(oraclePLSQLTypesEnumTypeConverter);
  descriptor.addMapping(wrappedDatabaseTypeMapping);
  return descriptor;
}

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

protected ClassDescriptor buildXMLAnyObjectMappingDescriptor() {
  ClassDescriptor descriptor = super.buildXMLAnyObjectMappingDescriptor();
  XMLDirectMapping keepAsElementMapping = new XMLDirectMapping();
  keepAsElementMapping.setAttributeName("keepAsElementPolicy");
  keepAsElementMapping.setGetMethodName("getKeepAsElementPolicy");
  keepAsElementMapping.setSetMethodName("setKeepAsElementPolicy");
  keepAsElementMapping.setXPath(getPrimaryNamespaceXPath() + "keep-as-element-policy");
  EnumTypeConverter converter = new EnumTypeConverter(keepAsElementMapping, UnmarshalKeepAsElementPolicy.class, false);
  keepAsElementMapping.setConverter(converter);
  descriptor.addMapping(keepAsElementMapping);
  return descriptor;
}

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

protected ClassDescriptor buildSimplePLSQLTypeWrapperDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(SimplePLSQLTypeWrapper.class);
  descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class);
  XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping();
  wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType");
  wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME);
  EnumTypeConverter oraclePLSQLTypesEnumTypeConverter = new EnumTypeConverter(
    wrappedDatabaseTypeMapping, OraclePLSQLTypes.class, false);
  wrappedDatabaseTypeMapping.setConverter(oraclePLSQLTypesEnumTypeConverter);
  descriptor.addMapping(wrappedDatabaseTypeMapping);
  return descriptor;
}

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

protected ClassDescriptor buildJDBCTypeWrapperDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(JDBCTypeWrapper.class);
  descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class);
  XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping();
  wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType");
  wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME);
  EnumTypeConverter jdbcTypesEnumTypeConverter = new EnumTypeConverter(
    wrappedDatabaseTypeMapping, JDBCTypes.class, false);
  wrappedDatabaseTypeMapping.setConverter(jdbcTypesEnumTypeConverter);
  descriptor.addMapping(wrappedDatabaseTypeMapping);
  return descriptor;
}

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

protected ClassDescriptor buildSimplePLSQLTypeWrapperDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(SimplePLSQLTypeWrapper.class);
  descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class);
  XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping();
  wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType");
  wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME);
  EnumTypeConverter oraclePLSQLTypesEnumTypeConverter = new EnumTypeConverter(
    wrappedDatabaseTypeMapping, OraclePLSQLTypes.class, false);
  wrappedDatabaseTypeMapping.setConverter(oraclePLSQLTypesEnumTypeConverter);
  descriptor.addMapping(wrappedDatabaseTypeMapping);
  return descriptor;
}

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

protected ClassDescriptor buildJDBCTypeWrapperDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(JDBCTypeWrapper.class);
  descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class);
  XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping();
  wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType");
  wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME);
  EnumTypeConverter jdbcTypesEnumTypeConverter = new EnumTypeConverter(
    wrappedDatabaseTypeMapping, JDBCTypes.class, false);
  wrappedDatabaseTypeMapping.setConverter(jdbcTypesEnumTypeConverter);
  descriptor.addMapping(wrappedDatabaseTypeMapping);
  return descriptor;
}

代码示例来源: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 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;
}

相关文章