Problem with NativeQuery return types

#1

Hello,

in Hibernate 5.3.2 I was able to execute a native query using a return type like this:

  String result = entityManager.createNativeQuery(SELECT AD_DB_MODIFIED() FROM DUAL, String.class).uniqueResult();

where AD_DB_MODIFIED() is a custom SQL function.

but in Hibernate 5.4.2 that very same statement is throwing the following exception: “javax.persistence.PersistenceException: org.hibernate.MappingException: Unknown entity: java.lang.String

After debugging a little bit, I’ve found that this is related with the following changeset.

What do you think? Is this a regression?

1 Like