code: private static boolean isPersisted(Attribute attr) {
      return !attr.hasExpression()
          && attr.getDataType() != COMPOUND
          && !(attr.getDataType() == ONE_TO_MANY && attr.isMappedBy());
    }
docs: Indicates if the attribute is persisted in the database. Compound attributes, computed
  attributes with an expression and one-to-many mappedBy attributes are not persisted.
  
  @param attr the attribute to check
  @return boolean indicating if the entity is persisted in the database.