201201import org .hibernate .sql .ast .tree .select .SelectStatement ;
202202import org .hibernate .sql .exec .spi .JdbcOperation ;
203203import org .hibernate .sql .exec .spi .JdbcParametersList ;
204- import org .hibernate .sql .model .ast .ColumnValueBinding ;
205- import org .hibernate .sql .model .ast .MutatingTableReference ;
206204import org .hibernate .sql .model .ast .builder .MutationGroupBuilder ;
207205import org .hibernate .sql .model .ast .builder .TableInsertBuilder ;
208206import org .hibernate .sql .results .graph .DomainResult ;
@@ -1457,8 +1455,7 @@ private Object initializedLazyField(
14571455 }
14581456
14591457 if ( CORE_LOGGER .isTraceEnabled () ) {
1460- CORE_LOGGER .tracev (
1461- "Initializing lazy properties of: {0}, field access: {1}" ,
1458+ CORE_LOGGER .initializingLazyPropertiesOf (
14621459 infoString ( this , id , getFactory () ),
14631460 fieldName
14641461 );
@@ -1601,7 +1598,7 @@ private Object initLazyProperties(
16011598 SharedSessionContractImplementor session ) {
16021599
16031600 assert hasLazyProperties ();
1604- CORE_LOGGER .tracef ( "Initializing lazy properties from datastore (triggered for '%s')" , fieldName );
1601+ CORE_LOGGER .initializingLazyPropertiesFromDatastore ( fieldName );
16051602
16061603 final var interceptor = asPersistentAttributeInterceptable ( entity ).$$_hibernate_getInterceptor ();
16071604 assert interceptor != null : "Expecting bytecode interceptor to be non-null" ;
@@ -1639,7 +1636,7 @@ private Object initLazyProperties(
16391636 }
16401637 }
16411638 }
1642- CORE_LOGGER .trace ( "Done initializing lazy properties" );
1639+ CORE_LOGGER .doneInitializingLazyProperties ( );
16431640 return finalResult ;
16441641 }
16451642 catch (JDBCException ex ) {
@@ -1700,7 +1697,7 @@ protected Object initializeLazyPropertiesFromCache(
17001697 final SharedSessionContractImplementor session ,
17011698 final EntityEntry entry ,
17021699 final CacheEntry cacheEntry ) {
1703- CORE_LOGGER .trace ( "Initializing lazy properties from second-level cache" );
1700+ CORE_LOGGER .initializingLazyPropertiesFromSecondLevelCache ( );
17041701 Object result = null ;
17051702 final var disassembledValues = cacheEntry .getDisassembledState ();
17061703 for ( int j = 0 ; j < lazyPropertyNames .length ; j ++ ) {
@@ -1718,7 +1715,7 @@ protected Object initializeLazyPropertiesFromCache(
17181715 }
17191716 }
17201717 }
1721- CORE_LOGGER .trace ( "Done initializing lazy properties" );
1718+ CORE_LOGGER .doneInitializingLazyProperties ( );
17221719 return result ;
17231720 }
17241721
@@ -2034,8 +2031,7 @@ public Object[] getDatabaseSnapshot(Object id, SharedSessionContractImplementor
20342031 @ Override
20352032 public Object getIdByUniqueKey (Object key , String uniquePropertyName , SharedSessionContractImplementor session ) {
20362033 if ( CORE_LOGGER .isTraceEnabled () ) {
2037- CORE_LOGGER .tracef ( "resolving unique key [%s] to identifier for entity [%s]" ,
2038- key , getEntityName () );
2034+ CORE_LOGGER .resolvingUniqueKeyToIdentifier ( key , getEntityName () );
20392035 }
20402036
20412037 return getUniqueKeyLoader ( uniquePropertyName , session ).resolveId ( key , session );
@@ -2094,8 +2090,8 @@ private Object calculateNextVersion(Object id, Object currentVersion, SharedSess
20942090 .generate ( session , null , currentVersion , FORCE_INCREMENT );
20952091 if ( CORE_LOGGER .isTraceEnabled () ) {
20962092 final var versionType = getVersionType ();
2097- CORE_LOGGER .trace (
2098- "Forcing version increment [" + infoString ( this , id , factory ) + "; "
2093+ CORE_LOGGER .forcingVersionIncrement (
2094+ "[" + infoString ( this , id , factory ) + "; "
20992095 + versionType .toLoggableString ( currentVersion , factory ) + " -> "
21002096 + versionType .toLoggableString ( nextVersion , factory ) + "]"
21012097 );
@@ -2137,7 +2133,7 @@ else if ( isVersionGeneratedOnExecution() ) {
21372133 public Object getCurrentVersion (Object id , SharedSessionContractImplementor session ) throws HibernateException {
21382134
21392135 if ( CORE_LOGGER .isTraceEnabled () ) {
2140- CORE_LOGGER .tracev ( "Getting version: {0}" , infoString ( this , id , getFactory () ) );
2136+ CORE_LOGGER .readingEntityVersion ( infoString ( this , id , getFactory () ) );
21412137 }
21422138 final String versionSelectString = getVersionSelectString ();
21432139 try {
@@ -3513,7 +3509,7 @@ public Object load(Object id, Object optionalObject, LockOptions lockOptions, Sh
35133509 private Object doLoad (Object id , Object optionalObject , LockOptions lockOptions , Boolean readOnly , SharedSessionContractImplementor session )
35143510 throws HibernateException {
35153511 if ( CORE_LOGGER .isTraceEnabled () ) {
3516- CORE_LOGGER .tracev ( "Fetching entity: {0}" , infoString ( this , id , getFactory () ) );
3512+ CORE_LOGGER .fetchingEntity ( infoString ( this , id , getFactory () ) );
35173513 }
35183514
35193515 final SingleIdEntityLoader <?> loader = determineLoaderToUse ( session , lockOptions );
@@ -3731,7 +3727,7 @@ private void logDirtyProperties(int[] props) {
37313727 if ( CORE_LOGGER .isTraceEnabled () ) {
37323728 for ( int prop : props ) {
37333729 final String propertyName = getAttributeMapping ( prop ).getAttributeName ();
3734- CORE_LOGGER .trace ( qualify ( getEntityName (), propertyName ) + " is dirty" );
3730+ CORE_LOGGER .propertyIsDirty ( qualify ( getEntityName (), propertyName ) );
37353731 }
37363732 }
37373733 }
@@ -4431,11 +4427,7 @@ protected void verifyHasNaturalId() {
44314427 public Object getNaturalIdentifierSnapshot (Object id , SharedSessionContractImplementor session ) {
44324428 verifyHasNaturalId ();
44334429 if ( CORE_LOGGER .isTraceEnabled () ) {
4434- CORE_LOGGER .tracef (
4435- "Getting current natural-id snapshot state for `%s#%s" ,
4436- getEntityName (),
4437- id
4438- );
4430+ CORE_LOGGER .gettingCurrentNaturalIdSnapshot ( getEntityName (), id );
44394431 }
44404432 return getNaturalIdLoader ().resolveIdToNaturalId ( id , session );
44414433 }
0 commit comments