code: private String createAlias(PAttr attr) {
  
          // This is a simple property -> should not create an alias
          if (attr instanceof AIdAttr)
              return ((AIdAttr) attr).getIdentifier().getText().trim();
  
          // In the other case, we have a compound property -> must create an alias (or reuse an existing one) and return the alias name to the property path
  
          // Loop through all parts and create aliasses along the way.
          List<String> propertyParts = getPropertyParts(attr);
          String currentPropertyPath = ""; // the current property path
          String currentAlias = "";
          for (int i = 0; i < propertyParts.size() - 1; i++) { // last part is the final property itself.. must not create an alias for that one
  
              String currentPropertyPart = propertyParts.get(i);
              currentPropertyPath += currentPropertyPart;
  
              if (createdAliasses.containsKey(currentPropertyPath)) // already have an alias
                  currentAlias = createdAliasses.get(currentPropertyPath);
              else {
  
                  String newAlias = currentAlias + currentPropertyPart + "01";
                  criteria = criteria.createAlias((currentAlias.length() == 0 ? "" :(currentAlias + ".")) + currentPropertyPart, newAlias);
                  createdAliasses.put(currentPropertyPath, newAlias);
                  currentAlias = newAlias;
              }
  
              currentPropertyPath += ".";
          }
  
          String lastPropertyPart = propertyParts.get(propertyParts.size()-1); // Last (missing) part of the property path.
          return currentAlias.length() == 0 ? lastPropertyPart : currentAlias + "." + lastPropertyPart;
      }
docs: Creates an alias for the property's parent if necessary (the property is compound)
  E.g. for a property path "address.street.number", an alias is created for "address.street", which can be used to
  access the number property.
  
  @param attr The attribute/property node to create an alias for.
  @return The aliased Property name