コード例 #1
0
 /**
  * Adds mapping of the id of a related entity to the given xml mapping, prefixing the id with the
  * given prefix.
  *
  * @param xmlMapping Mapping, to which to add the xml.
  * @param prefix Prefix for the names of properties which will be prepended to properties that
  *     form the id.
  * @param columnNameIterator Iterator over the column names that will be used for properties that
  *     form the id.
  * @param relatedIdMapping Id mapping data of the related entity.
  */
 @SuppressWarnings({"unchecked"})
 private void addRelatedToXmlMapping(
     Element xmlMapping,
     String prefix,
     MetadataTools.ColumnNameIterator columnNameIterator,
     IdMappingData relatedIdMapping) {
   Element properties = (Element) relatedIdMapping.getXmlRelationMapping().clone();
   MetadataTools.prefixNamesInPropertyElement(properties, prefix, columnNameIterator, true, true);
   for (Element idProperty : (java.util.List<Element>) properties.elements()) {
     xmlMapping.add((Element) idProperty.clone());
   }
 }
コード例 #2
0
 /**
  * @param ele
  * @param beitihuanwenben
  * @param tihuanwenben
  * @return 替换后的 ele的复制版本,
  */
 public static Element tiHuanWenBen(Element ele, String beitihuanwenben, String tihuanwenben) {
   Element ls = (Element) ele.clone();
   Element ls01 = getElement(ls, beitihuanwenben, TiHuanType.TEXT);
   ls01.setText(tihuanwenben);
   return ls;
 }