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

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

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

XMLDirectMapping.getConverter介绍

暂无

代码示例

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

@Override
protected ClassDescriptor buildClassDescriptorDescriptor() {
  ClassDescriptor descriptor = super.buildClassDescriptorDescriptor();
  XMLDirectMapping identityMapClassMapping = (XMLDirectMapping)descriptor.getMappingForAttributeName("identityMapClass");
  ObjectTypeConverter identityMapClassConverter = (ObjectTypeConverter)identityMapClassMapping.getConverter();
  identityMapClassConverter.addConversionValue("soft-reference", SoftIdentityMap.class);
  XMLDirectMapping remoteIdentityMapClassMapping = (XMLDirectMapping)descriptor.getMappingForAttributeName("remoteIdentityMapClass");
  ObjectTypeConverter remoteIdentityMapClassConverter = (ObjectTypeConverter)remoteIdentityMapClassMapping.getConverter();
  remoteIdentityMapClassConverter.addConversionValue("soft-reference", SoftIdentityMap.class);
  XMLDirectMapping unitOfWorkCacheIsolationLevelMapping = (XMLDirectMapping)descriptor.getMappingForAttributeName("unitOfWorkCacheIsolationLevel");
  ObjectTypeConverter unitOfWorkCacheIsolationLevelConverter = (ObjectTypeConverter)unitOfWorkCacheIsolationLevelMapping.getConverter();
  unitOfWorkCacheIsolationLevelConverter.addConversionValue("default", Integer.valueOf(ClassDescriptor.UNDEFINED_ISOLATATION));
  unitOfWorkCacheIsolationLevelMapping.setNullValue(Integer.valueOf(ClassDescriptor.UNDEFINED_ISOLATATION));
  return descriptor;
}

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

public Converter getConverter(XMLField field) {
  if(null != this.fieldsToConverters) {
    Converter converter = fieldsToConverters.get(field);
    if(null != converter) {
      return converter;
    }
    if(null != this.choiceElementMappings) {
      DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field);
      if(null == mapping) {
        return null;
      }
      if(mapping.isAbstractCompositeDirectCollectionMapping()) {
        return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter();
      } else if(mapping.isAbstractDirectMapping()) {
        return ((XMLDirectMapping)mapping).getConverter();
      }
    }
  }
  return null;
}

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

public Converter getConverter(XMLField field) {
  if(null != this.fieldsToConverters) {
    Converter converter = fieldsToConverters.get(field);
    if(null != converter) {
      return converter;
    }
    if(null != this.choiceElementMappings) {
      DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field);
      if(null == mapping) {
        return null;
      }
      if(mapping.isAbstractCompositeDirectCollectionMapping()) {
        return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter();
      } else if(mapping.isAbstractDirectMapping()) {
        return ((XMLDirectMapping)mapping).getConverter();
      }
    }
  }
  return null;
}

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

public Converter getConverter(XMLField field) {
  if(null != this.fieldsToConverters) {
    Converter converter = fieldsToConverters.get(field);
    if(null != converter) {
      return converter;
    }
    if(null != this.choiceElementMappings) {
      DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field);
      if(null == mapping) {
        return null;
      }
      if(mapping.isAbstractCompositeDirectCollectionMapping()) {
        return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter();
      } else if(mapping.isAbstractDirectMapping()) {
        return ((XMLDirectMapping)mapping).getConverter();
      }
    }
  }
  return null;
}

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

public Converter getConverter(XMLField field) {
  if(null != this.fieldsToConverters) {
    Converter converter = fieldsToConverters.get(field);
    if(null != converter) {
      return converter;
    }
    if(null != this.choiceElementMappings) {
      DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field);
      if(null == mapping) {
        return null;
      }
      if(mapping.isAbstractCompositeDirectCollectionMapping()) {
        return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter();
      } else if(mapping.isAbstractDirectMapping()) {
        return ((XMLDirectMapping)mapping).getConverter();
      }
    }
  }
  return null;
}

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

@Override
protected ClassDescriptor buildClassDescriptorDescriptor() {
  ClassDescriptor descriptor = super.buildClassDescriptorDescriptor();
  XMLDirectMapping identityMapClassMapping = (XMLDirectMapping)descriptor.getMappingForAttributeName("identityMapClass");
  ObjectTypeConverter identityMapClassConverter = (ObjectTypeConverter)identityMapClassMapping.getConverter();
  identityMapClassConverter.addConversionValue("soft-reference", SoftIdentityMap.class);
  XMLDirectMapping remoteIdentityMapClassMapping = (XMLDirectMapping)descriptor.getMappingForAttributeName("remoteIdentityMapClass");
  ObjectTypeConverter remoteIdentityMapClassConverter = (ObjectTypeConverter)remoteIdentityMapClassMapping.getConverter();
  remoteIdentityMapClassConverter.addConversionValue("soft-reference", SoftIdentityMap.class);
  XMLDirectMapping unitOfWorkCacheIsolationLevelMapping = (XMLDirectMapping)descriptor.getMappingForAttributeName("unitOfWorkCacheIsolationLevel");
  ObjectTypeConverter unitOfWorkCacheIsolationLevelConverter = (ObjectTypeConverter)unitOfWorkCacheIsolationLevelMapping.getConverter();
  unitOfWorkCacheIsolationLevelConverter.addConversionValue("default", Integer.valueOf(ClassDescriptor.UNDEFINED_ISOLATATION));
  unitOfWorkCacheIsolationLevelMapping.setNullValue(Integer.valueOf(ClassDescriptor.UNDEFINED_ISOLATATION));
  return descriptor;
}

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

@Override
protected ClassDescriptor buildClassDescriptorDescriptor() {
  ClassDescriptor descriptor = super.buildClassDescriptorDescriptor();
  XMLDirectMapping identityMapClassMapping = (XMLDirectMapping)descriptor.getMappingForAttributeName("identityMapClass");
  ObjectTypeConverter identityMapClassConverter = (ObjectTypeConverter)identityMapClassMapping.getConverter();
  identityMapClassConverter.addConversionValue("soft-reference", SoftIdentityMap.class);
  XMLDirectMapping remoteIdentityMapClassMapping = (XMLDirectMapping)descriptor.getMappingForAttributeName("remoteIdentityMapClass");
  ObjectTypeConverter remoteIdentityMapClassConverter = (ObjectTypeConverter)remoteIdentityMapClassMapping.getConverter();
  remoteIdentityMapClassConverter.addConversionValue("soft-reference", SoftIdentityMap.class);
  XMLDirectMapping unitOfWorkCacheIsolationLevelMapping = (XMLDirectMapping)descriptor.getMappingForAttributeName("unitOfWorkCacheIsolationLevel");
  ObjectTypeConverter unitOfWorkCacheIsolationLevelConverter = (ObjectTypeConverter)unitOfWorkCacheIsolationLevelMapping.getConverter();
  unitOfWorkCacheIsolationLevelConverter.addConversionValue("default", new Integer(ClassDescriptor.UNDEFINED_ISOLATATION));
  unitOfWorkCacheIsolationLevelMapping.setNullValue(new Integer(ClassDescriptor.UNDEFINED_ISOLATATION));
  return descriptor;
}

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

public Converter getConverter(XMLField field) {
  if(null != this.fieldsToConverters) {
    Converter converter = fieldsToConverters.get(field);
    if(null != converter) {
      return converter;
    }
    if(null != this.choiceElementMappings) {
      DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field);
      if(null == mapping) {
        return null;
      }
      if(mapping.isAbstractCompositeDirectCollectionMapping()) {
        return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter();
      } else if(mapping.isAbstractDirectMapping()) {
        return ((XMLDirectMapping)mapping).getConverter();
      }
    }
  }
  return null;
}

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

public Converter getConverter(XMLField field) {
  if(null != this.fieldsToConverters) {
    Converter converter = fieldsToConverters.get(field);
    if(null != converter) {
      return converter;
    }
    if(null != this.choiceElementMappings) {
      DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field);
      if(null == mapping) {
        return null;
      }
      if(mapping.isAbstractCompositeDirectCollectionMapping()) {
        return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter();
      } else if(mapping.isAbstractDirectMapping()) {
        return ((XMLDirectMapping)mapping).getConverter();
      }
    }
  }
  return null;
}

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

if (getConverter() instanceof XMLConverter) {
  fieldValue = ((XMLConverter)getConverter()).convertObjectValueToDataValue(fieldValue, session, record.getMarshaller());
} else {
  fieldValue = getConverter().convertObjectValueToDataValue(fieldValue, session);

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

if (getConverter() instanceof XMLConverter) {
  attributeValue = ((XMLConverter)getConverter()).convertDataValueToObjectValue(attributeValue, session, record.getUnmarshaller());
} else {
  attributeValue = getConverter().convertDataValueToObjectValue(attributeValue, session);

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

Converter converter = mapping.getConverter();
if (converter != null && converter instanceof EnumTypeConverter) {
  processEnumeration(schemaTypeString, frag, mapping, seq, ct, workingSchema, converter);

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

XMLDirectMapping directMapping = (XMLDirectMapping) mapping;
if (directMapping.hasConverter()) {
  newValue = directMapping.getConverter().convertDataValueToObjectValue(newValue, session);
} else {
  CoreField field = mapping.getField();

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

XMLDirectMapping directMapping = (XMLDirectMapping) mapping;
if (directMapping.hasConverter()) {
  newValue = directMapping.getConverter().convertDataValueToObjectValue(newValue, session);
} else {
  CoreField field = mapping.getField();

相关文章