Collection<Property> targetProperties = targetCategory.getProperties();
for(XProperty sourceProperty: sourceProperties) {
Property targetProperty = new Property();
targetProperty.setCategory(targetCategory);
targetProperty.setName(sourceProperty.getName());
PropertyType propertyType = (PropertyType) propertyTypeDAO.getById(sourceProperty.getPropertyType());
if(propertyType == null) {
throw new BusinessLogicException("Property type is unknown: '" + sourceProperty.getPropertyType() + "'");
}
targetProperty.setPropertyType(propertyType);
targetProperty.setDictionary(sourceProperty.getDictonary());