code: @Override
      public Object convertToEntityAttribute(String dbData) {
          if ("true".equalsIgnoreCase(dbData)) {
              return true;
          } else if ("false".equalsIgnoreCase(dbData)) {
              return false;
          } else if (NumberUtils.isParsable(dbData)) {
              if (NumberUtils.isDigits(dbData) ||
                  (dbData.startsWith("-") &&
                      NumberUtils.isDigits(dbData.substring(1)))) {
                  return Long.parseLong(dbData);
              } else {
                  return Double.parseDouble(dbData);
              }
          }
          return dbData;
      }
docs: Converts a string value from the database to the best matching java
  primitive type.