示例#1
0
 private void setupDefaultConverters() throws XavaException {
   Iterator it = propertyMappings.values().iterator();
   while (it.hasNext()) {
     PropertyMapping propertyMapping = (PropertyMapping) it.next();
     propertyMapping.setDefaultConverter();
   }
 }
示例#2
0
 private PropertyMapping getMappingForColumn(String column) throws XavaException {
   if (propertyMappings == null) {
     throw new ElementNotFoundException("mapping_not_found_no_property_mappings", column);
   }
   Iterator it = propertyMappings.values().iterator();
   while (it.hasNext()) {
     PropertyMapping propertyMapping = (PropertyMapping) it.next();
     if (propertyMapping.getColumn().equalsIgnoreCase(column)) {
       return propertyMapping;
     }
   }
   throw new ElementNotFoundException("mapping_for_column_not_found", column);
 }
示例#3
0
 /** @throws XavaException If it does not have a overlapped property, or any other problem. */
 public String getOverlappingPropertyForReference(String reference, String propertyOfReference)
     throws XavaException {
   String column =
       getReferenceMapping(reference).getColumnForReferencedModelProperty(propertyOfReference);
   if (propertyMappings == null) {
     throw new XavaException("reference_property_not_overlapped", propertyOfReference, reference);
   }
   Iterator it = propertyMappings.values().iterator();
   while (it.hasNext()) {
     PropertyMapping mapping = (PropertyMapping) it.next();
     if (column.equalsIgnoreCase(mapping.getColumn())) return mapping.getProperty();
   }
   throw new XavaException("reference_property_not_overlapped", propertyOfReference, reference);
 }
示例#4
0
 private Collection getReferenceMappings() {
   return referenceMappings == null ? Collections.EMPTY_LIST : referenceMappings.values();
 }
示例#5
0
 private Collection getPropertyMappings() {
   return propertyMappings.values();
 }