Updated for Spring 5 baseline

The new Spring 5 baseline consists of Spring 5, Hibernate 5, and Java 8.
This commit addresses any changes to create a successful build of Spring
Batch under those guidances.  Further commits will be coming to address
Java 8 specifics as areas of the project are touched.

Resolves BATCH-2536
This commit is contained in:
Michael Minella
2016-09-30 12:34:28 -05:00
parent f4c0530730
commit b2e6b431dc
16 changed files with 131 additions and 95 deletions

View File

@@ -22,9 +22,10 @@ import org.apache.commons.logging.LogFactory;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.context.spi.CurrentSessionContext;
import org.springframework.batch.item.ItemWriter;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.orm.hibernate3.HibernateOperations;
import org.springframework.orm.hibernate5.HibernateOperations;
import org.springframework.util.Assert;
/**

View File

@@ -48,10 +48,10 @@ public class HibernateNativeQueryProvider<E> extends AbstractHibernateQueryProvi
public SQLQuery createQuery() {
if (isStatelessSession()) {
return getStatelessSession().createSQLQuery(sqlQuery).addEntity(entityClass);
return getStatelessSession().createNativeQuery(sqlQuery).addEntity(entityClass);
}
else {
return getStatefulSession().createSQLQuery(sqlQuery).addEntity(entityClass);
return getStatefulSession().createNativeQuery(sqlQuery).addEntity(entityClass);
}
}