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

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

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

XMLCompositeCollectionMapping.setAttributeAccessor介绍

暂无

代码示例

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

private void addChoiceElementMapping(XMLField xmlField, Class theClass){

  if (xmlField.getLastXPathFragment().nameIsText()) {
    XMLCompositeDirectCollectionMapping xmlMapping = new XMLCompositeDirectCollectionMapping();            
    xmlMapping.setAttributeElementClass(theClass);
    xmlMapping.setField(xmlField);
    xmlMapping.setAttributeAccessor(temporaryAccessor);
    this.choiceElementMappings.put(xmlField, xmlMapping);                
  } else {
    XMLCompositeCollectionMapping xmlMapping = new XMLCompositeCollectionMapping();            
    if(!theClass.equals(ClassConstants.OBJECT)){
      xmlMapping.setReferenceClass(theClass);
    }
    xmlMapping.setField(xmlField);
    xmlMapping.setAttributeAccessor(temporaryAccessor);
    this.choiceElementMappings.put(xmlField, xmlMapping);                
  }        
}

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

private void addChoiceElementMapping(XMLField xmlField, String className){              
   if (xmlField.getLastXPathFragment().nameIsText()) {
     XMLCompositeDirectCollectionMapping xmlMapping = new XMLCompositeDirectCollectionMapping();             
     Class theClass = XMLConversionManager.getDefaultXMLManager().convertClassNameToClass(className);
     xmlMapping.setAttributeElementClass(theClass);             
     xmlMapping.setField(xmlField);             
     xmlMapping.setAttributeAccessor(temporaryAccessor);
     this.choiceElementMappings.put(xmlField, xmlMapping);                
   } else {
     XMLCompositeCollectionMapping xmlMapping = new XMLCompositeCollectionMapping();  
     if(!className.equals("java.lang.Object")){
      xmlMapping.setReferenceClassName(className);
     }      
     xmlMapping.setField(xmlField);
     xmlMapping.setAttributeAccessor(temporaryAccessor);
     this.choiceElementMappings.put(xmlField, xmlMapping);                
   }        
}

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

private void addChoiceElementMapping(XMLField xmlField, Class theClass){
  if (xmlField.getLastXPathFragment().nameIsText() || xmlField.getLastXPathFragment().isAttribute()) {
    XMLCompositeDirectCollectionMapping xmlMapping = new XMLCompositeDirectCollectionMapping();
    xmlMapping.setAttributeElementClass(theClass);
    xmlMapping.setField(xmlField);
    xmlMapping.setAttributeAccessor(temporaryAccessor);
    this.choiceElementMappings.put(xmlField, xmlMapping);
    this.choiceElementMappingsByClass.put(theClass, xmlMapping);
  } else {
    if(isBinaryType(theClass)) {
      XMLBinaryDataCollectionMapping xmlMapping = new XMLBinaryDataCollectionMapping();
      xmlMapping.setField(xmlField);
      xmlMapping.setAttributeElementClass(theClass);
      xmlMapping.setAttributeAccessor(temporaryAccessor);
      this.fieldsToConverters.put(xmlField, xmlMapping.getValueConverter());
      this.choiceElementMappings.put(xmlField, xmlMapping);
      this.choiceElementMappingsByClass.put(theClass, xmlMapping);
    } else {
      XMLCompositeCollectionMapping xmlMapping = new XMLCompositeCollectionMapping();
      if(!theClass.equals(ClassConstants.OBJECT)){
        xmlMapping.setReferenceClass(theClass);
      }
      xmlMapping.setField(xmlField);
      xmlMapping.setAttributeAccessor(temporaryAccessor);
      this.choiceElementMappings.put(xmlField, xmlMapping);
      this.choiceElementMappingsByClass.put(theClass, xmlMapping);
    }
  }
}

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

xmlMapping.setAttributeAccessor(temporaryAccessor);
this.choiceElementMappings.put(xmlField, xmlMapping);
this.choiceElementMappingsByClass.put(theClass, xmlMapping);

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

private void addChoiceElementMapping(XMLField xmlField, String className){
   if (xmlField.getLastXPathFragment().nameIsText() || xmlField.getLastXPathFragment().isAttribute()) {
     XMLCompositeDirectCollectionMapping xmlMapping = new XMLCompositeDirectCollectionMapping();
     xmlMapping.setAttributeElementClassName(className);
     xmlMapping.setField(xmlField);
     xmlMapping.setAttributeAccessor(temporaryAccessor);
     this.choiceElementMappings.put(xmlField, xmlMapping);
     this.choiceElementMappingsByClassName.put(className, xmlMapping);
   } else {
     if(isBinaryType(className)) {
       XMLBinaryDataCollectionMapping xmlMapping = new XMLBinaryDataCollectionMapping();
       xmlMapping.setField(xmlField);
       xmlMapping.setAttributeAccessor(temporaryAccessor);
       Class theClass = XMLConversionManager.getDefaultXMLManager().convertClassNameToClass(className);
       xmlMapping.setAttributeElementClass(theClass);
       this.choiceElementMappings.put(xmlField, xmlMapping);
       this.choiceElementMappingsByClassName.put(className, xmlMapping);
     } else {
       XMLCompositeCollectionMapping xmlMapping = new XMLCompositeCollectionMapping();
       if(!className.equals("java.lang.Object")){
         xmlMapping.setReferenceClassName(className);
       }
       xmlMapping.setField(xmlField);
       xmlMapping.setAttributeAccessor(temporaryAccessor);
       this.choiceElementMappings.put(xmlField, xmlMapping);
       this.choiceElementMappingsByClassName.put(className, xmlMapping);
     }
   }
}

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

private void addChoiceElementMapping(XMLField xmlField, String className){              
   if (xmlField.getLastXPathFragment().nameIsText() || xmlField.getLastXPathFragment().isAttribute()) {
     XMLCompositeDirectCollectionMapping xmlMapping = new XMLCompositeDirectCollectionMapping();             
     xmlMapping.setAttributeElementClassName(className);             
     xmlMapping.setField(xmlField);             
     xmlMapping.setAttributeAccessor(temporaryAccessor);
     this.choiceElementMappings.put(xmlField, xmlMapping);
     this.choiceElementMappingsByClassName.put(className, xmlMapping);
   } else {
     if(isBinaryType(className)) {
       XMLBinaryDataCollectionMapping xmlMapping = new XMLBinaryDataCollectionMapping();
       xmlMapping.setField(xmlField);
       xmlMapping.setAttributeAccessor(temporaryAccessor);
       Class theClass = XMLConversionManager.getDefaultXMLManager().convertClassNameToClass(className);
       xmlMapping.setAttributeElementClass(theClass);
       this.choiceElementMappings.put(xmlField, xmlMapping);
       this.choiceElementMappingsByClassName.put(className, xmlMapping);
     } else {
       XMLCompositeCollectionMapping xmlMapping = new XMLCompositeCollectionMapping();  
       if(!className.equals("java.lang.Object")){
         xmlMapping.setReferenceClassName(className);
       }      
       xmlMapping.setField(xmlField);
       xmlMapping.setAttributeAccessor(temporaryAccessor);
       this.choiceElementMappings.put(xmlField, xmlMapping);
       this.choiceElementMappingsByClassName.put(className, xmlMapping);
     }
   }        
}

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

sourceToTargetKeyFieldAssociationsMapping.setReferenceClass(Association.class);
sourceToTargetKeyFieldAssociationsMapping.setAttributeAccessor(new AttributeAccessor() {
    public Object getAttributeValueFromObject(Object object) {
      Map sourceToTargetKeyFields = ((XMLObjectReferenceMapping) object).getSourceToTargetKeyFieldAssociations();

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

aggregateToSourceFieldNameAssociationsMapping.setReferenceClass(FieldTranslation.class);
aggregateToSourceFieldNameAssociationsMapping.setAttributeAccessor(new AttributeAccessor() {
  public Object getAttributeValueFromObject(Object object) {

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

aggregateToSourceFieldNameAssociationsMapping.setReferenceClass(FieldTranslation.class);
aggregateToSourceFieldNameAssociationsMapping.setAttributeAccessor(new AttributeAccessor() {
  public Object getAttributeValueFromObject(Object object) {
    AggregateObjectMapping mapping = (AggregateObjectMapping)object;

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

sourceToTargetKeyFieldAssociationsMapping.setReferenceClass(Association.class);
sourceToTargetKeyFieldAssociationsMapping.setAttributeAccessor(new AttributeAccessor() {
    public Object getAttributeValueFromObject(Object object) {
      Map sourceToTargetKeyFields = ((XMLObjectReferenceMapping) object).getSourceToTargetKeyFieldAssociations();

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

aggregateToSourceFieldNameAssociationsMapping.setReferenceClass(FieldTranslation.class);
aggregateToSourceFieldNameAssociationsMapping.setAttributeAccessor(new AttributeAccessor() {
  @Override
  public Object getAttributeValueFromObject(Object object) {

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

sourceToTargetKeyFieldAssociationsMapping.setReferenceClass(Association.class);
sourceToTargetKeyFieldAssociationsMapping.setAttributeAccessor(new AttributeAccessor() {
    public Object getAttributeValueFromObject(Object object) {
      Map sourceToTargetKeyFields = ((XMLObjectReferenceMapping) object).getSourceToTargetKeyFieldAssociations();

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

protected ClassDescriptor buildStoredProcedureCallDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(StoredProcedureCall.class);
  descriptor.getInheritancePolicy().setParentClass(Call.class);
  descriptor.descriptorIsAggregate();
  XMLDirectMapping procedureNameMapping = new XMLDirectMapping();
  procedureNameMapping.setAttributeName("procedureName");
  procedureNameMapping.setGetMethodName("getProcedureName");
  procedureNameMapping.setSetMethodName("setProcedureName");
  procedureNameMapping.setXPath(getPrimaryNamespaceXPath() + "procedure-name/text()");
  descriptor.addMapping(procedureNameMapping);
  XMLDirectMapping cursorOutputProcedureMapping = new XMLDirectMapping();
  cursorOutputProcedureMapping.setAttributeName("isCursorOutputProcedure");
  cursorOutputProcedureMapping.setXPath(getPrimaryNamespaceXPath() + "cursor-output-procedure/text()");
  descriptor.addMapping(cursorOutputProcedureMapping);
  XMLCompositeCollectionMapping storedProcArgumentsMapping = new XMLCompositeCollectionMapping();
  storedProcArgumentsMapping.useCollectionClass(NonSynchronizedVector.class);
  storedProcArgumentsMapping.setAttributeName("procedureArguments");
  storedProcArgumentsMapping.setAttributeAccessor(new StoredProcedureArgumentsAccessor());
  storedProcArgumentsMapping.setReferenceClass(StoredProcedureArgument.class);
  storedProcArgumentsMapping.setXPath(getPrimaryNamespaceXPath() + "arguments/" + getPrimaryNamespaceXPath() + "argument");
  descriptor.addMapping(storedProcArgumentsMapping);
  return descriptor;
}

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

foreignKeyForMultipleTables.setAttributeName("foreignKeysForMultipleTables");
foreignKeyForMultipleTables.setXPath(getPrimaryNamespaceXPath() + "foreign-keys-for-multiple-table/" + getSecondaryNamespaceXPath() + "field-reference");
foreignKeyForMultipleTables.setAttributeAccessor(new AttributeAccessor() {
    public Object getAttributeValueFromObject(Object object) {
      ClassDescriptor descriptor = (ClassDescriptor) object;

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

foreignKeyForMultipleTables.setAttributeName("foreignKeysForMultipleTables");
foreignKeyForMultipleTables.setXPath(getPrimaryNamespaceXPath() + "foreign-keys-for-multiple-table/" + getSecondaryNamespaceXPath() + "field-reference");
foreignKeyForMultipleTables.setAttributeAccessor(new AttributeAccessor() {
    public Object getAttributeValueFromObject(Object object) {
      ClassDescriptor descriptor = (ClassDescriptor) object;

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

foreignKeyForMultipleTables.setAttributeName("foreignKeysForMultipleTables");
foreignKeyForMultipleTables.setXPath(getPrimaryNamespaceXPath() + "foreign-keys-for-multiple-table/" + getSecondaryNamespaceXPath() + "field-reference");
foreignKeyForMultipleTables.setAttributeAccessor(new AttributeAccessor() {
    public Object getAttributeValueFromObject(Object object) {
      ClassDescriptor descriptor = (ClassDescriptor) object;

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

fieldsMapping.setReferenceClass(ObjectTypeFieldAssociation.class);
fieldsMapping.setAttributeAccessor(new AttributeAccessor() {
  public Object getAttributeValueFromObject(Object object) {
    Map fields = ((OracleObjectType) object).getFields();

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

fieldsMapping.setReferenceClass(ObjectTypeFieldAssociation.class);
fieldsMapping.setAttributeAccessor(new AttributeAccessor() {
  public Object getAttributeValueFromObject(Object object) {
    Map fields = ((OracleObjectType) object).getFields();

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

protected ClassDescriptor buildStoredProcedureCallDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(StoredProcedureCall.class);
  descriptor.getInheritancePolicy().setParentClass(Call.class);
  descriptor.descriptorIsAggregate();
  XMLDirectMapping procedureNameMapping = new XMLDirectMapping();
  procedureNameMapping.setAttributeName("procedureName");
  procedureNameMapping.setGetMethodName("getProcedureName");
  procedureNameMapping.setSetMethodName("setProcedureName");
  procedureNameMapping.setXPath(getPrimaryNamespaceXPath() + "procedure-name/text()");
  descriptor.addMapping(procedureNameMapping);
  XMLDirectMapping cursorOutputProcedureMapping = new XMLDirectMapping();
  cursorOutputProcedureMapping.setAttributeName("isCursorOutputProcedure");
  cursorOutputProcedureMapping.setXPath(getPrimaryNamespaceXPath() + "cursor-output-procedure/text()");
  cursorOutputProcedureMapping.setNullValue(false);
  descriptor.addMapping(cursorOutputProcedureMapping);
  XMLCompositeCollectionMapping storedProcArgumentsMapping = new XMLCompositeCollectionMapping();
  storedProcArgumentsMapping.useCollectionClass(NonSynchronizedVector.class);
  storedProcArgumentsMapping.setAttributeName("procedureArguments");
  storedProcArgumentsMapping.setAttributeAccessor(new StoredProcedureArgumentsAccessor());
  storedProcArgumentsMapping.setReferenceClass(StoredProcedureArgument.class);
  storedProcArgumentsMapping.setXPath(getPrimaryNamespaceXPath() + "arguments/" + getPrimaryNamespaceXPath() + "argument");
  descriptor.addMapping(storedProcArgumentsMapping);
  XMLCompositeCollectionMapping optionalMapping = new XMLCompositeCollectionMapping();
  optionalMapping.setAttributeName("optionalArguments");
  optionalMapping.setXPath(getPrimaryNamespaceXPath() + "optional-arguments/" + getPrimaryNamespaceXPath() + "argument");
  optionalMapping.setReferenceClass(DatabaseField.class);
  descriptor.addMapping(optionalMapping);
  return descriptor;
}

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

protected ClassDescriptor buildStoredProcedureCallDescriptor() {
  XMLDescriptor descriptor = new XMLDescriptor();
  descriptor.setJavaClass(StoredProcedureCall.class);
  descriptor.getInheritancePolicy().setParentClass(Call.class);
  descriptor.descriptorIsAggregate();
  XMLDirectMapping procedureNameMapping = new XMLDirectMapping();
  procedureNameMapping.setAttributeName("procedureName");
  procedureNameMapping.setGetMethodName("getProcedureName");
  procedureNameMapping.setSetMethodName("setProcedureName");
  procedureNameMapping.setXPath(getPrimaryNamespaceXPath() + "procedure-name/text()");
  descriptor.addMapping(procedureNameMapping);
  XMLDirectMapping cursorOutputProcedureMapping = new XMLDirectMapping();
  cursorOutputProcedureMapping.setAttributeName("isCursorOutputProcedure");
  cursorOutputProcedureMapping.setXPath(getPrimaryNamespaceXPath() + "cursor-output-procedure/text()");
  cursorOutputProcedureMapping.setNullValue(false);
  descriptor.addMapping(cursorOutputProcedureMapping);
  XMLCompositeCollectionMapping storedProcArgumentsMapping = new XMLCompositeCollectionMapping();
  storedProcArgumentsMapping.useCollectionClass(NonSynchronizedVector.class);
  storedProcArgumentsMapping.setAttributeName("procedureArguments");
  storedProcArgumentsMapping.setAttributeAccessor(new StoredProcedureArgumentsAccessor());
  storedProcArgumentsMapping.setReferenceClass(StoredProcedureArgument.class);
  storedProcArgumentsMapping.setXPath(getPrimaryNamespaceXPath() + "arguments/" + getPrimaryNamespaceXPath() + "argument");
  descriptor.addMapping(storedProcArgumentsMapping);
  XMLCompositeCollectionMapping optionalMapping = new XMLCompositeCollectionMapping();
  optionalMapping.setAttributeName("optionalArguments");
  optionalMapping.setXPath(getPrimaryNamespaceXPath() + "optional-arguments/" + getPrimaryNamespaceXPath() + "argument");
  optionalMapping.setReferenceClass(DatabaseField.class);
  descriptor.addMapping(optionalMapping);
  return descriptor;
}

相关文章

XMLCompositeCollectionMapping类方法