// Make sure both types are not primitives since isAssignableFrom() does not work.
// For instance long and Long can't be compared but they are valid for JPQL query
TypeHelper typeHelper = typeRepository.getTypeHelper();
IType thisType = typeHelper.convertPrimitive(this);
otherType = typeHelper.convertPrimitive(otherType);
Class<?> thisClass = ((JavaType) thisType) .type;
Class<?> otherClass = ((JavaType) otherType).type;
return otherClass.isAssignableFrom(thisClass);