File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
hibernate-core/src/main/java/org/hibernate Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 11
11
12
12
import org .hibernate .AssertionFailure ;
13
13
import org .hibernate .persister .entity .EntityPersister ;
14
- import org .hibernate .pretty .MessageHelper ;
15
14
import org .hibernate .type .Type ;
16
15
17
16
import org .checkerframework .checker .nullness .qual .Nullable ;
18
17
18
+ import static org .hibernate .pretty .MessageHelper .infoString ;
19
+
19
20
/**
20
21
* Uniquely identifies of an entity instance in a particular Session by identifier.
21
22
* Note that it's only safe to be used within the scope of a Session: it doesn't consider for example the tenantId
@@ -117,7 +118,7 @@ public int hashCode() {
117
118
118
119
@ Override
119
120
public String toString () {
120
- return "EntityKey" + MessageHelper . infoString ( this .persister , identifier , persister .getFactory () );
121
+ return "EntityKey" + infoString ( this .persister , identifier , persister .getFactory () );
121
122
}
122
123
123
124
/**
Original file line number Diff line number Diff line change @@ -87,17 +87,15 @@ public static String infoString(
87
87
info .append ( " with null id" );
88
88
}
89
89
else {
90
- info .append ( " with id '" ). append ( id ). append ( "'" ) ;
90
+ info .append ( " with id '" );
91
91
if ( idType == null ) {
92
92
info .append ( id );
93
93
}
94
+ else if ( factory != null ) {
95
+ info .append ( idType .toLoggableString ( id , factory ) );
96
+ }
94
97
else {
95
- if ( factory != null ) {
96
- info .append ( idType .toLoggableString ( id , factory ) );
97
- }
98
- else {
99
- info .append ( "<not loggable>" );
100
- }
98
+ info .append ( "<not loggable>" );
101
99
}
102
100
info .append ( "'" );
103
101
}
You can’t perform that action at this time.
0 commit comments