/** * Set the Mapping field name attribute to the given XPath String * @param xpathString String */ public void setXPath(String xpathString) { this.setField(new XMLField(xpathString)); }
protected void initializeReferenceDescriptorAndField(AbstractSession session){ if (this.referenceClass != null) { super.initialize(session); } else { //below should be the same as AbstractCompositeObjectMapping.initialize if (this.field == null) { throw DescriptorException.fieldNameNotSetInMapping(this); } setField(getDescriptor().buildField(this.field)); setFields(collectFields()); // initialize the converter - if necessary if (hasConverter()) { getConverter().initialize(this, session); } } } /**
/** * Set the Mapping field name attribute to the given XPath String * @param xpathString String */ public void setXPath(String xpathString) { this.setField(new XMLField(xpathString)); }
protected void initializeReferenceDescriptorAndField(AbstractSession session){ if (this.referenceClass != null) { super.initialize(session); } else { //below should be the same as AbstractCompositeObjectMapping.initialize if (this.field == null) { throw DescriptorException.fieldNameNotSetInMapping(this); } setField(getDescriptor().buildField(this.field)); setFields(collectFields()); // initialize the converter - if necessary if (hasConverter()) { getConverter().initialize(this, session); } } } /**
/** * Set the Mapping field name attribute to the given XPath String * @param xpathString String */ public void setXPath(String xpathString) { this.setField(new XMLField(xpathString)); }
/** * INTERNAL: * The mapping is initialized with the given session. This mapping is fully initialized * after this. */ public void initialize(AbstractSession session) throws DescriptorException { //modified so that reference class on composite mappings is no longer mandatory if ((getReferenceClass() == null) && (getReferenceClassName() != null)) { setReferenceClass(session.getDatasourcePlatform().getConversionManager().convertClassNameToClass(getReferenceClassName())); } if (getReferenceClass() != null) { super.initialize(session); } else { //below should be the same as AbstractCompositeObjectMapping.initialize if (getField() == null) { throw DescriptorException.fieldNameNotSetInMapping(this); } setField(getDescriptor().buildField(getField())); setFields(collectFields()); // initialize the converter - if necessary if (hasConverter()) { getConverter().initialize(this, session); } } if(null != getContainerAccessor()) { getContainerAccessor().initializeAttributes(this.referenceClass); } }
private void addChoiceElementMapping(XMLField xmlField, Class theClass){ if (xmlField.getLastXPathFragment().nameIsText()) { XMLDirectMapping xmlMapping = new XMLDirectMapping(); xmlMapping.setAttributeClassification(theClass); xmlMapping.setAttributeAccessor(temporaryAccessor); xmlMapping.setField(xmlField); this.choiceElementMappings.put(xmlField, xmlMapping); } else { XMLCompositeObjectMapping xmlMapping = new XMLCompositeObjectMapping(); xmlMapping.setAttributeAccessor(temporaryAccessor); if(!theClass.equals(ClassConstants.OBJECT)){ xmlMapping.setReferenceClass(theClass); } xmlMapping.setField(xmlField); this.choiceElementMappings.put(xmlField, xmlMapping); } }
xmlMapping.setReferenceClassName(className); xmlMapping.setField(xmlField); if(this.choiceElementMappings.get(xmlField) == null) { this.choiceElementMappings.put(xmlField, xmlMapping);
private void addChoiceElementMapping(XMLField xmlField, String className){ if (xmlField.getLastXPathFragment().nameIsText()) { XMLDirectMapping xmlMapping = new XMLDirectMapping(); xmlMapping.setAttributeAccessor(temporaryAccessor); Class theClass = XMLConversionManager.getDefaultXMLManager().convertClassNameToClass(className); xmlMapping.setAttributeClassification(theClass); xmlMapping.setField(xmlField); this.choiceElementMappings.put(xmlField, xmlMapping); } else { XMLCompositeObjectMapping xmlMapping = new XMLCompositeObjectMapping(); xmlMapping.setAttributeAccessor(temporaryAccessor); if(!className.equals("java.lang.Object")){ xmlMapping.setReferenceClassName(className); } xmlMapping.setField(xmlField); this.choiceElementMappings.put(xmlField, xmlMapping); } }
xmlMapping.setReferenceClassName(className); xmlMapping.setField(xmlField); if(this.choiceElementMappings.get(xmlField) == null) { this.choiceElementMappings.put(xmlField, xmlMapping);
private void addChoiceElementMapping(XMLField xmlField, Class theClass){ if (xmlField.getLastXPathFragment().nameIsText() || xmlField.getLastXPathFragment().isAttribute()) { XMLDirectMapping xmlMapping = new XMLDirectMapping(); xmlMapping.setAttributeClassification(theClass); xmlMapping.setAttributeAccessor(temporaryAccessor); xmlMapping.setField(xmlField); this.choiceElementMappings.put(xmlField, xmlMapping); this.choiceElementMappingsByClass.put(theClass, xmlMapping); } else { if(isBinaryType(theClass)) { XMLBinaryDataMapping xmlMapping = new XMLBinaryDataMapping(); xmlMapping.setField(xmlField); xmlMapping.setAttributeClassification(theClass); xmlMapping.setAttributeAccessor(temporaryAccessor); this.choiceElementMappings.put(xmlField, xmlMapping); this.choiceElementMappingsByClass.put(theClass, xmlMapping); } else { XMLCompositeObjectMapping xmlMapping = new XMLCompositeObjectMapping(); xmlMapping.setAttributeAccessor(temporaryAccessor); if(!theClass.equals(ClassConstants.OBJECT)){ xmlMapping.setReferenceClass(theClass); } xmlMapping.setField(xmlField); this.choiceElementMappings.put(xmlField, xmlMapping); this.choiceElementMappingsByClass.put(theClass, xmlMapping); } } }
private void addChoiceElementMapping(XMLField xmlField, Class theClass){ if (xmlField.getLastXPathFragment().nameIsText() || xmlField.getLastXPathFragment().isAttribute()) { XMLDirectMapping xmlMapping = new XMLDirectMapping(); xmlMapping.setAttributeClassification(theClass); xmlMapping.setAttributeAccessor(temporaryAccessor); xmlMapping.setField(xmlField); this.choiceElementMappings.put(xmlField, xmlMapping); this.choiceElementMappingsByClass.put(theClass, xmlMapping); } else { if(isBinaryType(theClass)) { XMLBinaryDataMapping xmlMapping = new XMLBinaryDataMapping(); xmlMapping.setField(xmlField); xmlMapping.setAttributeClassification(theClass); xmlMapping.setAttributeAccessor(temporaryAccessor); this.choiceElementMappings.put(xmlField, xmlMapping); this.choiceElementMappingsByClass.put(theClass, xmlMapping); } else { XMLCompositeObjectMapping xmlMapping = new XMLCompositeObjectMapping(); xmlMapping.setAttributeAccessor(temporaryAccessor); if(!theClass.equals(ClassConstants.OBJECT)){ xmlMapping.setReferenceClass(theClass); } xmlMapping.setField(xmlField); this.choiceElementMappings.put(xmlField, xmlMapping); this.choiceElementMappingsByClass.put(theClass, xmlMapping); } } }
hrefMapping.setSetMethodName("_persistence_setHref"); hrefMapping.setDescriptor(descriptor); hrefMapping.setField(new XMLField("_link")); hrefMapping.setReferenceClass(Link.class); hrefMapping.setXPath(".");
hrefMapping.setSetMethodName("_persistence_setHref"); hrefMapping.setDescriptor(descriptor); hrefMapping.setField(new XMLField("_link")); hrefMapping.setReferenceClass(Link.class); hrefMapping.setXPath(".");