We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66b4eb1 commit 27471e0Copy full SHA for 27471e0
org.springframework.orm/src/main/java/org/springframework/orm/jpa/AbstractEntityManagerFactoryBean.java
@@ -507,6 +507,13 @@ else if (method.getName().equals("hashCode")) {
507
// Use hashCode of EntityManagerFactory proxy.
508
return System.identityHashCode(proxy);
509
}
510
+ else if (method.getName().equals("unwrap")) {
511
+ // Handle JPA 2.1 unwrap method - could be a proxy match.
512
+ Class targetClass = (Class) args[0];
513
+ if (targetClass == null || targetClass.isInstance(proxy)) {
514
+ return proxy;
515
+ }
516
517
return this.entityManagerFactoryBean.invokeProxyMethod(method, args);
518
519
catch (InvocationTargetException ex) {
0 commit comments