diff --git a/build.gradle b/build.gradle
index d9eb04e104..06d80b0b65 100644
--- a/build.gradle
+++ b/build.gradle
@@ -431,10 +431,9 @@ project('spring-orm') {
// our respective orm.hibernate3 and orm.hibernate4 packages
compile("aopalliance:aopalliance:1.0")
compile("org.hibernate:com.springsource.org.hibernate:3.3.1.GA", optional)
- compile("org.hibernate:hibernate-core:4.1.0.Final", optional)
compile("org.hibernate:hibernate-cglib-repack:2.1_3", optional)
compile("org.hibernate:hibernate-annotations:3.4.0.GA", optional)
- compile("org.hibernate:hibernate-entitymanager:4.1.0.Final", optional)
+ compile("org.hibernate:hibernate-entitymanager:3.4.0.GA", optional)
compile("org.apache.openjpa:openjpa:1.1.0", optional)
compile("org.eclipse.persistence:org.eclipse.persistence.core:1.0.1", optional)
compile("org.eclipse.persistence:org.eclipse.persistence.jpa:1.0.1", optional)
@@ -459,6 +458,24 @@ project('spring-orm') {
}
}
+project('spring-orm-hibernate4') {
+ description = 'Spring Object/Relational Mapping - Hibernate 4 support'
+ ext.mergeIntoProject = project(':spring-orm')
+ apply from: "${gradleScriptDir}/merge-artifacts.gradle"
+ dependencies {
+ compile project(":spring-orm").sourceSets.main.output
+ compile project(":spring-tx")
+ compile project(":spring-jdbc")
+ compile("org.hibernate:hibernate-core:4.1.0.Final", optional)
+ compile("org.hibernate:hibernate-entitymanager:4.1.0.Final", optional)
+ compile(project(":spring-web")) { dep ->
+ optional dep
+ exclude group: 'javax.persistence', module: 'persistence-api'
+ }
+ compile("javax.servlet:servlet-api:2.5", optional)
+ }
+}
+
project('spring-webmvc') {
description = 'Spring Web MVC'
dependencies {
diff --git a/settings.gradle b/settings.gradle
index f46b8bd6ae..d171d9c7c4 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -12,6 +12,7 @@ include 'spring-instrument-tomcat'
include 'spring-jdbc'
include 'spring-jms'
include 'spring-orm'
+include 'spring-orm-hibernate4'
include 'spring-oxm'
include 'spring-struts'
include 'spring-test'
diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/ConfigurableJtaPlatform.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/ConfigurableJtaPlatform.java
similarity index 100%
rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/ConfigurableJtaPlatform.java
rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/ConfigurableJtaPlatform.java
diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateExceptionTranslator.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateExceptionTranslator.java
similarity index 97%
rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateExceptionTranslator.java
rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateExceptionTranslator.java
index ab263ae3c4..4801a5afbc 100644
--- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateExceptionTranslator.java
+++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateExceptionTranslator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateJdbcException.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateJdbcException.java
similarity index 96%
rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateJdbcException.java
rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateJdbcException.java
index 238e5b532d..a7888faf07 100644
--- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateJdbcException.java
+++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateJdbcException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateObjectRetrievalFailureException.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateObjectRetrievalFailureException.java
similarity index 96%
rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateObjectRetrievalFailureException.java
rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateObjectRetrievalFailureException.java
index 5275e39fe1..b74453cc42 100644
--- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateObjectRetrievalFailureException.java
+++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateObjectRetrievalFailureException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateOptimisticLockingFailureException.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateOptimisticLockingFailureException.java
similarity index 96%
rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateOptimisticLockingFailureException.java
rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateOptimisticLockingFailureException.java
index c77abd5f83..ae97b30733 100644
--- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateOptimisticLockingFailureException.java
+++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateOptimisticLockingFailureException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateQueryException.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateQueryException.java
similarity index 95%
rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateQueryException.java
rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateQueryException.java
index 1a38936824..171465089f 100644
--- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateQueryException.java
+++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateQueryException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateSystemException.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateSystemException.java
similarity index 96%
rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateSystemException.java
rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateSystemException.java
index 1dd1fdd51c..da83a5f798 100644
--- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateSystemException.java
+++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateSystemException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateTransactionManager.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateTransactionManager.java
similarity index 97%
rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateTransactionManager.java
rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateTransactionManager.java
index 28983de9e5..250334fd63 100644
--- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/HibernateTransactionManager.java
+++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateTransactionManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -16,7 +16,6 @@
package org.springframework.orm.hibernate4;
-import java.lang.reflect.Method;
import java.sql.Connection;
import javax.sql.DataSource;
@@ -45,8 +44,6 @@ import org.springframework.transaction.support.AbstractPlatformTransactionManage
import org.springframework.transaction.support.DefaultTransactionStatus;
import org.springframework.transaction.support.ResourceTransactionManager;
import org.springframework.transaction.support.TransactionSynchronizationManager;
-import org.springframework.util.ClassUtils;
-import org.springframework.util.ReflectionUtils;
/**
* {@link org.springframework.transaction.PlatformTransactionManager}
@@ -105,15 +102,6 @@ import org.springframework.util.ReflectionUtils;
public class HibernateTransactionManager extends AbstractPlatformTransactionManager
implements ResourceTransactionManager, InitializingBean {
- /**
- * A Method handle for the SessionFactory.getCurrentSession()
method.
- * The return value differs between Hibernate 3.x and 4.x; for cross-compilation purposes,
- * we have to use reflection here as long as we keep compiling against Hibernate 3.x jars.
- */
- private static final Method getCurrentSessionMethod =
- ClassUtils.getMethod(SessionFactory.class, "getCurrentSession");
-
-
private SessionFactory sessionFactory;
private DataSource dataSource;
@@ -293,7 +281,7 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana
}
else if (this.hibernateManagedSession) {
try {
- Session session = (Session) ReflectionUtils.invokeMethod(getCurrentSessionMethod, this.sessionFactory);
+ Session session = this.sessionFactory.getCurrentSession();
if (logger.isDebugEnabled()) {
logger.debug("Found Hibernate-managed Session [" + session + "] for Spring-managed transaction");
}
@@ -337,7 +325,7 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana
try {
if (txObject.getSessionHolder() == null || txObject.getSessionHolder().isSynchronizedWithTransaction()) {
- Session newSession = SessionFactoryUtils.openSession(getSessionFactory());
+ Session newSession = getSessionFactory().openSession();
if (logger.isDebugEnabled()) {
logger.debug("Opened new Session [" + newSession + "] for Hibernate transaction");
}
diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/LocalSessionFactoryBean.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/LocalSessionFactoryBean.java
similarity index 100%
rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/LocalSessionFactoryBean.java
rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/LocalSessionFactoryBean.java
diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/LocalSessionFactoryBuilder.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/LocalSessionFactoryBuilder.java
similarity index 95%
rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/LocalSessionFactoryBuilder.java
rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/LocalSessionFactoryBuilder.java
index 0a4bc9ee20..6ad987fdfe 100644
--- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/LocalSessionFactoryBuilder.java
+++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/LocalSessionFactoryBuilder.java
@@ -17,7 +17,6 @@
package org.springframework.orm.hibernate4;
import java.io.IOException;
-import java.lang.reflect.Method;
import javax.persistence.Embeddable;
import javax.persistence.Entity;
import javax.persistence.MappedSuperclass;
@@ -46,7 +45,6 @@ import org.springframework.core.type.filter.TypeFilter;
import org.springframework.transaction.jta.JtaTransactionManager;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
-import org.springframework.util.ReflectionUtils;
/**
* A Spring-provided extension of the standard Hibernate {@link Configuration} class,
@@ -75,13 +73,6 @@ public class LocalSessionFactoryBuilder extends Configuration {
new AnnotationTypeFilter(Embeddable.class, false),
new AnnotationTypeFilter(MappedSuperclass.class, false)};
- private static final Method addAnnotatedClassMethod =
- ClassUtils.getMethod(Configuration.class, "addAnnotatedClass", Class.class);
-
- private static final Method addPackageMethod =
- ClassUtils.getMethod(Configuration.class, "addPackage", String.class);
-
-
private final ResourcePatternResolver resourcePatternResolver;
@@ -169,7 +160,7 @@ public class LocalSessionFactoryBuilder extends Configuration {
*/
public LocalSessionFactoryBuilder addAnnotatedClasses(Class>... annotatedClasses) {
for (Class> annotatedClass : annotatedClasses) {
- ReflectionUtils.invokeMethod(addAnnotatedClassMethod, this, annotatedClass);
+ addAnnotatedClass(annotatedClass);
}
return this;
}
@@ -181,7 +172,7 @@ public class LocalSessionFactoryBuilder extends Configuration {
*/
public LocalSessionFactoryBuilder addPackages(String... annotatedPackages) {
for (String annotatedPackage :annotatedPackages) {
- ReflectionUtils.invokeMethod(addPackageMethod, this, annotatedPackage);
+ addPackage(annotatedPackage);
}
return this;
}
diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/SessionFactoryUtils.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SessionFactoryUtils.java
similarity index 89%
rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/SessionFactoryUtils.java
rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SessionFactoryUtils.java
index db67bb66bd..2a8a5cd549 100644
--- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/SessionFactoryUtils.java
+++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SessionFactoryUtils.java
@@ -16,7 +16,6 @@
package org.springframework.orm.hibernate4;
-import java.lang.reflect.Method;
import javax.sql.DataSource;
import org.apache.commons.logging.Log;
@@ -53,8 +52,6 @@ import org.springframework.dao.IncorrectResultSizeDataAccessException;
import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.dao.InvalidDataAccessResourceUsageException;
import org.springframework.jdbc.datasource.DataSourceUtils;
-import org.springframework.util.ClassUtils;
-import org.springframework.util.ReflectionUtils;
/**
* Helper class featuring methods for Hibernate Session handling.
@@ -79,13 +76,6 @@ public abstract class SessionFactoryUtils {
public static final int SESSION_SYNCHRONIZATION_ORDER =
DataSourceUtils.CONNECTION_SYNCHRONIZATION_ORDER - 100;
- /**
- * A Method handle for the SessionFactory.openSession()
method.
- * The return value differs between Hibernate 3.x and 4.x; for cross-compilation purposes,
- * we have to use reflection here as long as we keep compiling against Hibernate 3.x jars.
- */
- private static final Method openSessionMethod = ClassUtils.getMethod(SessionFactory.class, "openSession");
-
static final Log logger = LogFactory.getLog(SessionFactoryUtils.class);
@@ -103,17 +93,6 @@ public abstract class SessionFactoryUtils {
return null;
}
- /**
- * Obtain a new Session from the given SessionFactory.
- *
Bridges between Hibernate signature differences. - * @param sessionFactory the SessionFactory to use - * @return the new Session - * @see org.hibernate.SessionFactory#openSession() - */ - public static Session openSession(SessionFactory sessionFactory) { - return (Session) ReflectionUtils.invokeMethod(openSessionMethod, sessionFactory); - } - /** * Perform actual closing of the Hibernate Session, * catching and logging any cleanup exceptions thrown. diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/SessionHolder.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SessionHolder.java similarity index 97% rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/SessionHolder.java rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SessionHolder.java index b67da8c5ed..67bb9c6339 100644 --- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/SessionHolder.java +++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SessionHolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/SpringFlushSynchronization.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SpringFlushSynchronization.java similarity index 96% rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/SpringFlushSynchronization.java rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SpringFlushSynchronization.java index 19edea3cd9..3850846a7a 100644 --- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/SpringFlushSynchronization.java +++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SpringFlushSynchronization.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/SpringJtaSessionContext.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SpringJtaSessionContext.java similarity index 96% rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/SpringJtaSessionContext.java rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SpringJtaSessionContext.java index e77d36cac6..9c3941d306 100644 --- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/SpringJtaSessionContext.java +++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SpringJtaSessionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/SpringSessionContext.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SpringSessionContext.java similarity index 98% rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/SpringSessionContext.java rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SpringSessionContext.java index ffbca16e40..1a5c4bd678 100644 --- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/SpringSessionContext.java +++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SpringSessionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/SpringSessionSynchronization.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SpringSessionSynchronization.java similarity index 98% rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/SpringSessionSynchronization.java rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SpringSessionSynchronization.java index 19f47c86fc..a831617d9c 100644 --- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/SpringSessionSynchronization.java +++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SpringSessionSynchronization.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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. diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/package-info.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/package-info.java similarity index 100% rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/package-info.java rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/package-info.java diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewFilter.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewFilter.java similarity index 99% rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewFilter.java rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewFilter.java index 3c85540e20..56b8b1a71f 100644 --- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewFilter.java +++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewFilter.java @@ -203,7 +203,7 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter { */ protected Session openSession(SessionFactory sessionFactory) throws DataAccessResourceFailureException { try { - Session session = SessionFactoryUtils.openSession(sessionFactory); + Session session = sessionFactory.openSession(); session.setFlushMode(FlushMode.MANUAL); return session; } diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewInterceptor.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewInterceptor.java similarity index 99% rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewInterceptor.java rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewInterceptor.java index 3b5677f83d..1a237a097a 100644 --- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewInterceptor.java +++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/support/OpenSessionInViewInterceptor.java @@ -184,7 +184,7 @@ public class OpenSessionInViewInterceptor implements AsyncWebRequestInterceptor */ protected Session openSession() throws DataAccessResourceFailureException { try { - Session session = SessionFactoryUtils.openSession(getSessionFactory()); + Session session = getSessionFactory().openSession(); session.setFlushMode(FlushMode.MANUAL); return session; } diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate4/support/package-info.java b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/support/package-info.java similarity index 92% rename from spring-orm/src/main/java/org/springframework/orm/hibernate4/support/package-info.java rename to spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/support/package-info.java index 10cd7a2758..a761ff6ad4 100644 --- a/spring-orm/src/main/java/org/springframework/orm/hibernate4/support/package-info.java +++ b/spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/support/package-info.java @@ -1,6 +1,6 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 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.