Changeset 7375


Ignore:
Timestamp:
May 18, 2017, 3:32:21 PM (5 years ago)
Author:
Nicklas Nordborg
Message:

References #2084: Upgrade to Hibernate 5.2

Using createNativeQuery() with a return type that is not a defined entity (for example Integer) caused Hibernate to complain. The variant without a return type seems to work though...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/hibernate-5.2/src/core/net/sf/basedb/core/HibernateUtil.java

    r7374 r7375  
    19441944    try
    19451945    {
    1946       NativeQuery<R> q = session.createNativeQuery(sql, returnType);
     1946      NativeQuery<R> q = session.createNativeQuery(sql);
    19471947      ((Query<R>)q).setFetchSize(getJdbcFetchSize());
    19481948      return q;
     
    19871987    try
    19881988    {
    1989       NativeQuery<R> q = session.createNativeQuery(sql, returnType);
     1989      // Specifying non-entity (for example, Integer) return type makes Hibernate go bananas
     1990      // Guess it is a bug, but until it has been fixed, we need to use the non-specific method call
     1991      NativeQuery<R> q = session.createNativeQuery(sql); //, returnType);
    19901992      ((Query<R>)q).setFetchSize(getJdbcFetchSize());
    19911993      return q;
Note: See TracChangeset for help on using the changeset viewer.