Avoid defensive checks against Java 8 API (java.util.Optional etc)
This commit also fixes broken javadoc links and code references. Issue: SPR-13188
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -279,7 +279,7 @@ public class LocalContainerEntityManagerFactoryBean extends AbstractEntityManage
|
||||
* InstrumentationLoadTimeWeaver, which requires a Spring-specific (but very general)
|
||||
* VM agent specified on JVM startup, and ReflectiveLoadTimeWeaver, which interacts
|
||||
* with an underlying ClassLoader based on specific extended methods being available
|
||||
* on it (for example, interacting with Spring's TomcatInstrumentableClassLoader).
|
||||
* on it.
|
||||
* <p><b>NOTE:</b> As of Spring 2.5, the context's default LoadTimeWeaver (defined
|
||||
* as bean with name "loadTimeWeaver") will be picked up automatically, if available,
|
||||
* removing the need for LoadTimeWeaver configuration on each affected target bean.</b>
|
||||
@@ -290,7 +290,6 @@ public class LocalContainerEntityManagerFactoryBean extends AbstractEntityManage
|
||||
* is responsible for the weaving configuration.
|
||||
* @see org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver
|
||||
* @see org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
|
||||
* @see org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader
|
||||
*/
|
||||
@Override
|
||||
public void setLoadTimeWeaver(LoadTimeWeaver loadTimeWeaver) {
|
||||
|
||||
@@ -176,6 +176,7 @@ public class HibernateJpaDialect extends DefaultJpaDialect {
|
||||
return new SessionTransactionData(session, previousFlushMode, null, null);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
protected FlushMode prepareFlushMode(Session session, boolean readOnly) throws PersistenceException {
|
||||
FlushMode flushMode = (FlushMode) ReflectionUtils.invokeMethod(getFlushMode, session);
|
||||
if (readOnly) {
|
||||
@@ -330,6 +331,7 @@ public class HibernateJpaDialect extends DefaultJpaDialect {
|
||||
this.previousIsolationLevel = previousIsolationLevel;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void resetSessionState() {
|
||||
if (this.previousFlushMode != null) {
|
||||
this.session.setFlushMode(this.previousFlushMode);
|
||||
|
||||
@@ -24,16 +24,12 @@ import javax.persistence.spi.PersistenceProvider;
|
||||
|
||||
import org.hibernate.cfg.Environment;
|
||||
import org.hibernate.dialect.DB2Dialect;
|
||||
import org.hibernate.dialect.DerbyDialect;
|
||||
import org.hibernate.dialect.H2Dialect;
|
||||
import org.hibernate.dialect.HSQLDialect;
|
||||
import org.hibernate.dialect.InformixDialect;
|
||||
import org.hibernate.dialect.MySQLDialect;
|
||||
import org.hibernate.dialect.Oracle9iDialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.dialect.SQLServerDialect;
|
||||
import org.hibernate.jpa.HibernateEntityManager;
|
||||
import org.hibernate.jpa.HibernateEntityManagerFactory;
|
||||
|
||||
/**
|
||||
* {@link org.springframework.orm.jpa.JpaVendorAdapter} implementation for Hibernate
|
||||
@@ -64,12 +60,11 @@ public class HibernateJpaVendorAdapter extends AbstractJpaVendorAdapter {
|
||||
private final Class<? extends EntityManager> entityManagerInterface;
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings("deprecation")
|
||||
public HibernateJpaVendorAdapter() {
|
||||
ClassLoader cl = HibernateJpaVendorAdapter.class.getClassLoader();
|
||||
this.persistenceProvider = new SpringHibernateJpaPersistenceProvider();
|
||||
this.entityManagerFactoryInterface = HibernateEntityManagerFactory.class;
|
||||
this.entityManagerInterface = HibernateEntityManager.class;
|
||||
this.entityManagerFactoryInterface = org.hibernate.jpa.HibernateEntityManagerFactory.class;
|
||||
this.entityManagerInterface = org.hibernate.jpa.HibernateEntityManager.class;
|
||||
}
|
||||
|
||||
|
||||
@@ -142,13 +137,13 @@ public class HibernateJpaVendorAdapter extends AbstractJpaVendorAdapter {
|
||||
protected Class<?> determineDatabaseDialectClass(Database database) {
|
||||
switch (database) {
|
||||
case DB2: return DB2Dialect.class;
|
||||
case DERBY: return DerbyDialect.class;
|
||||
case DERBY: return org.hibernate.dialect.DerbyDialect.class;
|
||||
case H2: return H2Dialect.class;
|
||||
case HSQL: return HSQLDialect.class;
|
||||
case INFORMIX: return InformixDialect.class;
|
||||
case MYSQL: return MySQLDialect.class;
|
||||
case ORACLE: return Oracle9iDialect.class;
|
||||
case POSTGRESQL: return PostgreSQLDialect.class;
|
||||
case POSTGRESQL: return org.hibernate.dialect.PostgreSQLDialect.class;
|
||||
case SQL_SERVER: return SQLServerDialect.class;
|
||||
case SYBASE: return org.hibernate.dialect.SybaseDialect.class;
|
||||
default: return null;
|
||||
|
||||
Reference in New Issue
Block a user