Clean up warnings on Hibernate support code

This commit is contained in:
Sam Brannen
2015-07-21 23:39:07 +02:00
parent edd6e76b9f
commit ed20b3771c
10 changed files with 19 additions and 37 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -343,7 +343,6 @@ public class HibernateTemplate extends HibernateAccessor implements HibernateOpe
@Override
@Deprecated
@SuppressWarnings("unchecked")
public List<?> executeFind(HibernateCallback<?> action) throws DataAccessException {
Object result = doExecute(action, false, false);
if (result != null && !(result instanceof List)) {
@@ -974,7 +973,6 @@ public class HibernateTemplate extends HibernateAccessor implements HibernateOpe
public List<?> find(final String queryString, final Object... values) throws DataAccessException {
return executeWithNativeSession(new HibernateCallback<List<?>>() {
@Override
@SuppressWarnings("unchecked")
public List<?> doInHibernate(Session session) throws HibernateException {
Query queryObject = session.createQuery(queryString);
prepareQuery(queryObject);
@@ -1004,7 +1002,6 @@ public class HibernateTemplate extends HibernateAccessor implements HibernateOpe
}
return executeWithNativeSession(new HibernateCallback<List<?>>() {
@Override
@SuppressWarnings("unchecked")
public List<?> doInHibernate(Session session) throws HibernateException {
Query queryObject = session.createQuery(queryString);
prepareQuery(queryObject);
@@ -1024,7 +1021,6 @@ public class HibernateTemplate extends HibernateAccessor implements HibernateOpe
return executeWithNativeSession(new HibernateCallback<List<?>>() {
@Override
@SuppressWarnings("unchecked")
public List<?> doInHibernate(Session session) throws HibernateException {
Query queryObject = session.createQuery(queryString);
prepareQuery(queryObject);
@@ -1053,7 +1049,6 @@ public class HibernateTemplate extends HibernateAccessor implements HibernateOpe
public List<?> findByNamedQuery(final String queryName, final Object... values) throws DataAccessException {
return executeWithNativeSession(new HibernateCallback<List<?>>() {
@Override
@SuppressWarnings("unchecked")
public List<?> doInHibernate(Session session) throws HibernateException {
Query queryObject = session.getNamedQuery(queryName);
prepareQuery(queryObject);
@@ -1084,7 +1079,6 @@ public class HibernateTemplate extends HibernateAccessor implements HibernateOpe
}
return executeWithNativeSession(new HibernateCallback<List<?>>() {
@Override
@SuppressWarnings("unchecked")
public List<?> doInHibernate(Session session) throws HibernateException {
Query queryObject = session.getNamedQuery(queryName);
prepareQuery(queryObject);
@@ -1104,7 +1098,6 @@ public class HibernateTemplate extends HibernateAccessor implements HibernateOpe
return executeWithNativeSession(new HibernateCallback<List<?>>() {
@Override
@SuppressWarnings("unchecked")
public List<?> doInHibernate(Session session) throws HibernateException {
Query queryObject = session.getNamedQuery(queryName);
prepareQuery(queryObject);
@@ -1131,7 +1124,6 @@ public class HibernateTemplate extends HibernateAccessor implements HibernateOpe
Assert.notNull(criteria, "DetachedCriteria must not be null");
return executeWithNativeSession(new HibernateCallback<List<?>>() {
@Override
@SuppressWarnings("unchecked")
public List<?> doInHibernate(Session session) throws HibernateException {
Criteria executableCriteria = criteria.getExecutableCriteria(session);
prepareCriteria(executableCriteria);
@@ -1205,7 +1197,6 @@ public class HibernateTemplate extends HibernateAccessor implements HibernateOpe
public Iterator<?> iterate(final String queryString, final Object... values) throws DataAccessException {
return executeWithNativeSession(new HibernateCallback<Iterator<?>>() {
@Override
@SuppressWarnings("unchecked")
public Iterator<?> doInHibernate(Session session) throws HibernateException {
Query queryObject = session.createQuery(queryString);
prepareQuery(queryObject);

View File

@@ -76,7 +76,7 @@ import org.springframework.util.ReflectionUtils;
* @author Costin Leau
* @since 2.0
*/
@SuppressWarnings({"serial", "deprecation"})
@SuppressWarnings("serial")
public class HibernateJpaDialect extends DefaultJpaDialect {
private static Class<?> optimisticLockExceptionClass;

View File

@@ -70,7 +70,7 @@ public class HibernateJpaVendorAdapter extends AbstractJpaVendorAdapter {
private final Class<? extends EntityManager> entityManagerInterface;
@SuppressWarnings({"deprecation", "unchecked"})
@SuppressWarnings("unchecked")
public HibernateJpaVendorAdapter() {
ClassLoader cl = HibernateJpaVendorAdapter.class.getClassLoader();
Class<? extends EntityManagerFactory> emfIfcToUse;