|
6 | 6 | import java.lang.reflect.Method;
|
7 | 7 | import java.util.HashMap;
|
8 | 8 |
|
9 |
| -import org.hibernate.engine.spi.SessionFactoryImplementor; |
10 |
| -import org.hibernate.engine.spi.SessionImplementor; |
11 |
| -import org.hibernate.engine.spi.SharedSessionContractImplementor; |
12 | 9 | import org.hibernate.proxy.HibernateProxy;
|
13 | 10 | import org.hibernate.proxy.LazyInitializer;
|
14 | 11 | import org.hibernate.proxy.pojo.BasicLazyInitializer;
|
@@ -250,12 +247,9 @@ private String getIdentifierPropertyName(final LazyInitializer init) {
|
250 | 247 | if (_mapping != null) {
|
251 | 248 | idName = _mapping.getIdentifierPropertyName(init.getEntityName());
|
252 | 249 | } else {
|
253 |
| - idName = ProxySessionReader.getIdentifierPropertyName(init); |
| 250 | + idName = ProxyReader.getIdentifierPropertyName(init); |
254 | 251 | if (idName == null) {
|
255 |
| - idName = ProxyReader.getIdentifierPropertyName(init); |
256 |
| - if (idName == null) { |
257 |
| - idName = init.getEntityName(); |
258 |
| - } |
| 252 | + idName = init.getEntityName(); |
259 | 253 | }
|
260 | 254 | }
|
261 | 255 | return idName;
|
@@ -301,16 +295,4 @@ static String getIdentifierPropertyName(LazyInitializer init) {
|
301 | 295 | }
|
302 | 296 | }
|
303 | 297 | }
|
304 |
| - |
305 |
| - protected static class ProxySessionReader { |
306 |
| - static String getIdentifierPropertyName(LazyInitializer init) { |
307 |
| - final SharedSessionContractImplementor session = init.getSession(); |
308 |
| - if (session != null) { |
309 |
| - SessionFactoryImplementor factory = session.getFactory(); |
310 |
| - //TODO fixme - used to work with Hibernate 6, but not anymore |
311 |
| - //return factory.getIdentifierPropertyName(init.getEntityName()); |
312 |
| - } |
313 |
| - return null; |
314 |
| - } |
315 |
| - } |
316 | 298 | }
|
0 commit comments