|
5 | 5 | */
|
6 | 6 | package org.hibernate.reactive.persister.entity.impl;
|
7 | 7 |
|
8 |
| -import java.lang.invoke.MethodHandles; |
9 | 8 | import java.sql.PreparedStatement;
|
10 | 9 | import java.sql.ResultSet;
|
11 | 10 | import java.sql.SQLException;
|
|
43 | 42 | import org.hibernate.reactive.loader.ast.internal.ReactiveSingleIdArrayLoadPlan;
|
44 | 43 | import org.hibernate.reactive.loader.ast.spi.ReactiveSingleIdEntityLoader;
|
45 | 44 | import org.hibernate.reactive.logging.impl.Log;
|
46 |
| -import org.hibernate.reactive.logging.impl.LoggerFactory; |
47 | 45 | import org.hibernate.reactive.metamodel.mapping.internal.ReactiveCompoundNaturalIdMapping;
|
48 | 46 | import org.hibernate.reactive.metamodel.mapping.internal.ReactiveSimpleNaturalIdMapping;
|
49 | 47 | import org.hibernate.reactive.pool.ReactiveConnection;
|
|
58 | 56 |
|
59 | 57 | import jakarta.persistence.metamodel.Attribute;
|
60 | 58 |
|
| 59 | +import static java.lang.invoke.MethodHandles.lookup; |
61 | 60 | import static java.util.Collections.emptyMap;
|
62 | 61 | import static org.hibernate.generator.EventType.INSERT;
|
63 | 62 | import static org.hibernate.generator.EventType.UPDATE;
|
64 | 63 | import static org.hibernate.internal.util.collections.CollectionHelper.setOfSize;
|
65 | 64 | import static org.hibernate.pretty.MessageHelper.infoString;
|
| 65 | +import static org.hibernate.reactive.logging.impl.LoggerFactory.make; |
66 | 66 | import static org.hibernate.reactive.util.impl.CompletionStages.completedFuture;
|
67 | 67 | import static org.hibernate.reactive.util.impl.CompletionStages.failedFuture;
|
68 | 68 | import static org.hibernate.reactive.util.impl.CompletionStages.logSqlException;
|
|
90 | 90 | */
|
91 | 91 | public interface ReactiveAbstractEntityPersister extends ReactiveEntityPersister {
|
92 | 92 |
|
93 |
| - Log LOG = LoggerFactory.make( Log.class, MethodHandles.lookup() ); |
94 |
| - |
95 | 93 | default Parameters parameters() {
|
96 | 94 | return Parameters.instance( getFactory().getJdbcServices().getDialect() );
|
97 | 95 | }
|
@@ -259,6 +257,7 @@ default Object nextVersionForLock(LockMode lockMode, Object id, Object currentVe
|
259 | 257 | final Object nextVersion = getVersionJavaType()
|
260 | 258 | .next( currentVersion, versionMapping.getLength(), versionMapping.getPrecision(), versionMapping.getScale(), session );
|
261 | 259 |
|
| 260 | + Log LOG = make( Log.class, lookup() ); |
262 | 261 | if ( LOG.isTraceEnabled() ) {
|
263 | 262 | LOG.trace( "Forcing version increment [" + infoString( this, id, getFactory() ) + "; "
|
264 | 263 | + versionType.toLoggableString( currentVersion, getFactory() ) + " -> "
|
@@ -289,6 +288,7 @@ default ReactiveSingleIdEntityLoader<?> getReactiveSingleIdEntityLoader() {
|
289 | 288 | */
|
290 | 289 | @Override
|
291 | 290 | default CompletionStage<Object> reactiveGetCurrentVersion(Object id, SharedSessionContractImplementor session) {
|
| 291 | + Log LOG = make( Log.class, lookup() ); |
292 | 292 | if ( LOG.isTraceEnabled() ) {
|
293 | 293 | LOG.tracev( "Getting version: {0}", infoString( this, id, getFactory() ) );
|
294 | 294 | }
|
@@ -379,7 +379,8 @@ default CompletionStage<Object> reactiveInitializeLazyPropertiesFromDatastore(
|
379 | 379 | throw new AssertionFailure( "Expecting bytecode interceptor to be non-null" );
|
380 | 380 | }
|
381 | 381 |
|
382 |
| - LOG.tracef( "Initializing lazy properties from datastore (triggered for `%s`)", fieldName ); |
| 382 | + make( Log.class, lookup() ) |
| 383 | + .tracef( "Initializing lazy properties from datastore (triggered for `%s`)", fieldName ); |
383 | 384 |
|
384 | 385 | final String fetchGroup = getEntityPersister().getBytecodeEnhancementMetadata()
|
385 | 386 | .getLazyAttributesMetadata()
|
@@ -459,7 +460,7 @@ default CompletionStage<Object> initLazyProperty(
|
459 | 460 | }
|
460 | 461 |
|
461 | 462 | return resultStage.thenApply( result -> {
|
462 |
| - LOG.trace( "Done initializing lazy properties" ); |
| 463 | + make( Log.class, lookup() ).trace( "Done initializing lazy properties" ); |
463 | 464 | return result;
|
464 | 465 | } );
|
465 | 466 | }
|
@@ -539,12 +540,8 @@ private CompletionStage<?> loadFromDatabaseOrCache(
|
539 | 540 |
|
540 | 541 | Object initializeLazyProperty(String fieldName, Object entity, SharedSessionContractImplementor session);
|
541 | 542 |
|
542 |
| - String[][] getLazyPropertyColumnAliases(); |
543 |
| - |
544 | 543 | ReactiveSingleIdArrayLoadPlan reactiveGetSQLLazySelectLoadPlan(String fetchGroup);
|
545 | 544 |
|
546 |
| - boolean isBatchable(); |
547 |
| - |
548 | 545 | /**
|
549 | 546 | * @see AbstractEntityPersister#generateNaturalIdMapping(MappingModelCreationProcess, PersistentClass)
|
550 | 547 | */
|
|
0 commit comments