private int compareTargetType(DataType rhs) {
        return (rhs instanceof ReferenceDataType) ? targetType.compareTo(((ReferenceDataType) rhs).targetType) : 0;
    }
Creates a new type where the numeric ID is based on the hash of targetType
document/src/main/java/com/yahoo/document/ReferenceDataType.java