code: @SuppressWarnings("unchecked")
    public Entity hydrate(Map<String, Object> dehydratedEntity, EntityType entityType) {
      LOG.trace("Hydrating entity: {} for entity {}", dehydratedEntity, entityType.getId());
  
      Entity hydratedEntity = entityManager.create(entityType, NO_POPULATE);
  
      for (Attribute attribute : entityType.getAtomicAttributes()) {
        // Only hydrate the attribute if it is NOT computed.
        // Computed attributes will be calculated based on the metadata
        if (attribute.getExpression() == null) {
          String name = attribute.getName();
          Object value = dehydratedEntity.get(name);
          if (value != null) {
            if (isMultipleReferenceType(attribute)) {
              // We can do this cast because during dehydration, mrefs and categorical mrefs are
              // stored as a List of Object
              value = entityManager.getReferences(attribute.getRefEntity(), (List<Object>) value);
            } else if (isSingleReferenceType(attribute)) {
              value = entityManager.getReference(attribute.getRefEntity(), value);
            }
          }
          hydratedEntity.set(name, value);
        }
      }
  
      return hydratedEntity;
    }
docs: Rehydrate an entity. Entity can be an {@link EntityWithComputedAttributes} if there are
  attributes present with an expression
  
  @param entityType metadata of the entity to rehydrate
  @param dehydratedEntity map with key value pairs representing this entity
  @return hydrated entity