|
22 | 22 | import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping; |
23 | 23 | import org.hibernate.persister.entity.EntityPersister; |
24 | 24 | import org.hibernate.proxy.LazyInitializer; |
25 | | -import org.hibernate.proxy.map.MapProxy; |
26 | 25 | import org.hibernate.reactive.session.ReactiveQueryProducer; |
27 | 26 | import org.hibernate.reactive.sql.exec.spi.ReactiveRowProcessingState; |
28 | 27 | import org.hibernate.reactive.sql.results.graph.ReactiveDomainResultsAssembler; |
|
36 | 35 | import org.hibernate.sql.results.graph.InitializerParent; |
37 | 36 | import org.hibernate.sql.results.graph.entity.EntityResultGraphNode; |
38 | 37 | import org.hibernate.sql.results.graph.entity.internal.EntityInitializerImpl; |
39 | | -import org.hibernate.sql.results.jdbc.spi.JdbcValuesSourceProcessingOptions; |
40 | 38 | import org.hibernate.sql.results.jdbc.spi.RowProcessingState; |
41 | 39 | import org.hibernate.stat.spi.StatisticsImplementor; |
42 | 40 | import org.hibernate.type.Type; |
43 | 41 |
|
44 | 42 | import static org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer.UNFETCHED_PROPERTY; |
45 | 43 | import static org.hibernate.engine.internal.ManagedTypeHelper.asPersistentAttributeInterceptable; |
46 | 44 | import static org.hibernate.engine.internal.ManagedTypeHelper.isPersistentAttributeInterceptable; |
47 | | -import static org.hibernate.loader.internal.CacheLoadHelper.loadFromSecondLevelCache; |
48 | 45 | import static org.hibernate.metamodel.mapping.ForeignKeyDescriptor.Nature.TARGET; |
49 | 46 | import static org.hibernate.proxy.HibernateProxy.extractLazyInitializer; |
50 | 47 | import static org.hibernate.reactive.util.impl.CompletionStages.completedFuture; |
@@ -578,47 +575,6 @@ else if ( getEntityDescriptor().canUseReferenceCacheEntries() ) { |
578 | 575 | } |
579 | 576 | } |
580 | 577 |
|
581 | | - // FIXME: I could change the scope of this method in ORM |
582 | | - private Object resolveToOptionalInstance(ReactiveEntityInitializerData data) { |
583 | | - if ( isResultInitializer() ) { |
584 | | - // this isEntityReturn bit is just for entity loaders, not hql/criteria |
585 | | - final JdbcValuesSourceProcessingOptions processingOptions = |
586 | | - data.getRowProcessingState().getJdbcValuesSourceProcessingState().getProcessingOptions(); |
587 | | - return matchesOptionalInstance( data, processingOptions ) ? processingOptions.getEffectiveOptionalObject() : null; |
588 | | - } |
589 | | - else { |
590 | | - return null; |
591 | | - } |
592 | | - } |
593 | | - |
594 | | - // FIXME: I could change the scope of this method in ORM |
595 | | - private boolean isProxyInstance(Object proxy) { |
596 | | - return proxy != null |
597 | | - && ( proxy instanceof MapProxy || getEntityDescriptor().getJavaType().getJavaTypeClass().isInstance( proxy ) ); |
598 | | - } |
599 | | - |
600 | | - // FIXME: I could change the scope of this method in ORM |
601 | | - private Object resolveInstanceFromCache(ReactiveEntityInitializerData data) { |
602 | | - return loadFromSecondLevelCache( |
603 | | - data.getRowProcessingState().getSession().asEventSource(), |
604 | | - null, |
605 | | - data.getLockMode(), |
606 | | - getEntityDescriptor(), |
607 | | - data.getEntityKey() |
608 | | - ); |
609 | | - } |
610 | | - |
611 | | - // FIXME: I could change the scope of this method in ORM |
612 | | - private boolean matchesOptionalInstance( |
613 | | - ReactiveEntityInitializerData data, |
614 | | - JdbcValuesSourceProcessingOptions processingOptions) { |
615 | | - final Object optionalEntityInstance = processingOptions.getEffectiveOptionalObject(); |
616 | | - final Object requestedEntityId = processingOptions.getEffectiveOptionalId(); |
617 | | - return requestedEntityId != null |
618 | | - && optionalEntityInstance != null |
619 | | - && requestedEntityId.equals( data.getEntityKey().getIdentifier() ); |
620 | | - } |
621 | | - |
622 | 578 | private boolean isExistingEntityInitialized(Object existingEntity) { |
623 | 579 | return Hibernate.isInitialized( existingEntity ); |
624 | 580 | } |
|
0 commit comments