The function getJavaType() on Attribute returns the type of the field it represents in the entity. This may be a primitive type. However, that leads to inconsistencies, for example when selecting that attribute in a tuple query. See the related test case for an example. I believe this issue might have been fixed on the master by the following PR: https://github.com/hibernate/hibernate-orm/pull/4784 If that is the case, it just needs to be backported to the current 5.x version. |