Query call chaining works with shared EntityManager proxy outside of transaction as well (SPR-6726)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2844 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
parent
0749baa867
commit
022e2b68d0
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2009 the original author or authors.
|
* Copyright 2002-2010 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.
|
||||||
|
|
@ -283,7 +283,8 @@ public abstract class SharedEntityManagerCreator {
|
||||||
|
|
||||||
// Invoke method on actual Query object.
|
// Invoke method on actual Query object.
|
||||||
try {
|
try {
|
||||||
return method.invoke(this.target, args);
|
Object retVal = method.invoke(this.target, args);
|
||||||
|
return (retVal == this.target ? proxy : retVal);
|
||||||
}
|
}
|
||||||
catch (InvocationTargetException ex) {
|
catch (InvocationTargetException ex) {
|
||||||
throw ex.getTargetException();
|
throw ex.getTargetException();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue