Polish Hibernate support and tests

- Fix Javadoc in HibernateTemplate so that it compiles in Eclipse.
 - Suppress generics warnings in HibernateTemplateTests.
 - Remove unnecessary deprecation warning suppression in constructor for
   LocalSessionFactoryBuilder.
This commit is contained in:
Sam Brannen 2014-01-28 15:41:42 +01:00
parent 5f8275a305
commit 63e023173b
4 changed files with 4 additions and 4 deletions

View File

@ -144,7 +144,7 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
* Sessions (for example, within a transaction). * Sessions (for example, within a transaction).
* @see #enableFilters(org.hibernate.Session) * @see #enableFilters(org.hibernate.Session)
* @see org.hibernate.Session#enableFilter(String) * @see org.hibernate.Session#enableFilter(String)
* @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setFilterDefinitions * @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setFilterDefinitions(org.springframework.orm.hibernate3.FilterDefinition...)
*/ */
public void setFilterNames(String... filterNames) { public void setFilterNames(String... filterNames) {
this.filterNames = filterNames; this.filterNames = filterNames;

View File

@ -133,7 +133,6 @@ public class LocalSessionFactoryBuilder extends Configuration {
* (may be {@code null}) * (may be {@code null})
* @param resourceLoader the ResourceLoader to load application classes from * @param resourceLoader the ResourceLoader to load application classes from
*/ */
@SuppressWarnings("deprecation")
public LocalSessionFactoryBuilder(DataSource dataSource, ResourceLoader resourceLoader) { public LocalSessionFactoryBuilder(DataSource dataSource, ResourceLoader resourceLoader) {
getProperties().put(Environment.CURRENT_SESSION_CONTEXT_CLASS, SpringSessionContext.class.getName()); getProperties().put(Environment.CURRENT_SESSION_CONTEXT_CLASS, SpringSessionContext.class.getName());
if (dataSource != null) { if (dataSource != null) {

View File

@ -52,7 +52,6 @@ import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.mockito.InOrder; import org.mockito.InOrder;
import org.springframework.dao.CannotAcquireLockException; import org.springframework.dao.CannotAcquireLockException;
import org.springframework.dao.DataAccessResourceFailureException; import org.springframework.dao.DataAccessResourceFailureException;
import org.springframework.dao.DataIntegrityViolationException; import org.springframework.dao.DataIntegrityViolationException;
@ -69,6 +68,7 @@ import static org.mockito.BDDMockito.*;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 4.0.1 * @since 4.0.1
*/ */
@SuppressWarnings({ "rawtypes", "unchecked" })
public class HibernateTemplateTests { public class HibernateTemplateTests {
private SessionFactory sessionFactory; private SessionFactory sessionFactory;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -73,6 +73,7 @@ import static org.mockito.BDDMockito.*;
* @author Phillip Webb * @author Phillip Webb
* @since 05.03.2005 * @since 05.03.2005
*/ */
@SuppressWarnings({ "rawtypes", "unchecked" })
public class HibernateTemplateTests { public class HibernateTemplateTests {
private SessionFactory sessionFactory; private SessionFactory sessionFactory;