/** * Find a Sphinx representation for a mapped property value type. * @param type a Hibernate type * @return a reportable representation of that type */ private static String reportType(String className, String propertyName) { final Type type = model.getPropertyType(className, propertyName); final UserType userType; if (type instanceof CustomType) { userType = ((CustomType) type).getUserType(); } else { userType = null; } if (type instanceof EnumType) { return "enumeration"; } else if (userType instanceof GenericEnumType) { @SuppressWarnings({"rawtypes", "unchecked"}) final Class<? extends Unit> unitQuantityClass = ((GenericEnumType) userType).getQuantityClass(); return "enumeration of " + linkToJavadoc(unitQuantityClass.getName()); } else if (type instanceof ListType || userType instanceof ListAsSQLArrayUserType) { return "list"; } else if (type instanceof MapType) { return "map"; } else { return "``" + type.getName() + "``"; } }