fix warnings in StatelessSessionImpl
This commit is contained in:
parent
362da7ebf1
commit
7e36768c65
|
@ -7,7 +7,6 @@
|
||||||
package org.hibernate.internal;
|
package org.hibernate.internal;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
|
@ -32,8 +31,6 @@ import org.hibernate.engine.spi.EntityHolder;
|
||||||
import org.hibernate.engine.spi.EntityKey;
|
import org.hibernate.engine.spi.EntityKey;
|
||||||
import org.hibernate.engine.spi.LoadQueryInfluencers;
|
import org.hibernate.engine.spi.LoadQueryInfluencers;
|
||||||
import org.hibernate.engine.spi.PersistenceContext;
|
import org.hibernate.engine.spi.PersistenceContext;
|
||||||
import org.hibernate.engine.spi.PersistentAttributeInterceptable;
|
|
||||||
import org.hibernate.engine.spi.PersistentAttributeInterceptor;
|
|
||||||
import org.hibernate.engine.transaction.internal.jta.JtaStatusHelper;
|
import org.hibernate.engine.transaction.internal.jta.JtaStatusHelper;
|
||||||
import org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform;
|
import org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform;
|
||||||
import org.hibernate.event.spi.PostDeleteEvent;
|
import org.hibernate.event.spi.PostDeleteEvent;
|
||||||
|
@ -71,7 +68,6 @@ import org.hibernate.tuple.entity.EntityMetamodel;
|
||||||
import jakarta.persistence.EntityGraph;
|
import jakarta.persistence.EntityGraph;
|
||||||
import jakarta.transaction.SystemException;
|
import jakarta.transaction.SystemException;
|
||||||
|
|
||||||
import static java.util.Arrays.asList;
|
|
||||||
import static org.hibernate.engine.internal.ManagedTypeHelper.asPersistentAttributeInterceptable;
|
import static org.hibernate.engine.internal.ManagedTypeHelper.asPersistentAttributeInterceptable;
|
||||||
import static org.hibernate.engine.internal.ManagedTypeHelper.isPersistentAttributeInterceptable;
|
import static org.hibernate.engine.internal.ManagedTypeHelper.isPersistentAttributeInterceptable;
|
||||||
import static org.hibernate.engine.internal.Versioning.incrementVersion;
|
import static org.hibernate.engine.internal.Versioning.incrementVersion;
|
||||||
|
@ -760,11 +756,8 @@ public class StatelessSessionImpl extends AbstractSharedSessionContract implemen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( isPersistentAttributeInterceptable( association ) ) {
|
else if ( isPersistentAttributeInterceptable( association ) ) {
|
||||||
final PersistentAttributeInterceptable interceptable = asPersistentAttributeInterceptable( association );
|
if ( asPersistentAttributeInterceptable( association ).$$_hibernate_getInterceptor()
|
||||||
final PersistentAttributeInterceptor interceptor = interceptable.$$_hibernate_getInterceptor();
|
instanceof EnhancementAsProxyLazinessInterceptor proxyInterceptor ) {
|
||||||
if ( interceptor instanceof EnhancementAsProxyLazinessInterceptor ) {
|
|
||||||
final EnhancementAsProxyLazinessInterceptor proxyInterceptor =
|
|
||||||
(EnhancementAsProxyLazinessInterceptor) interceptor;
|
|
||||||
proxyInterceptor.setSession( this );
|
proxyInterceptor.setSession( this );
|
||||||
try {
|
try {
|
||||||
proxyInterceptor.forceInitialize( association, null );
|
proxyInterceptor.forceInitialize( association, null );
|
||||||
|
@ -778,8 +771,7 @@ public class StatelessSessionImpl extends AbstractSharedSessionContract implemen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( association instanceof PersistentCollection ) {
|
else if ( association instanceof PersistentCollection<?> persistentCollection ) {
|
||||||
final PersistentCollection<?> persistentCollection = (PersistentCollection<?>) association;
|
|
||||||
if ( !persistentCollection.wasInitialized() ) {
|
if ( !persistentCollection.wasInitialized() ) {
|
||||||
final CollectionPersister collectionDescriptor = getFactory().getMappingMetamodel()
|
final CollectionPersister collectionDescriptor = getFactory().getMappingMetamodel()
|
||||||
.getCollectionDescriptor( persistentCollection.getRole() );
|
.getCollectionDescriptor( persistentCollection.getRole() );
|
||||||
|
|
Loading…
Reference in New Issue