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 1111
1212import org .hibernate .AssertionFailure ;
1313import org .hibernate .persister .entity .EntityPersister ;
14- import org .hibernate .pretty .MessageHelper ;
1514import org .hibernate .type .Type ;
1615
1716import org .checkerframework .checker .nullness .qual .Nullable ;
1817
18+ import static org .hibernate .pretty .MessageHelper .infoString ;
19+
1920/**
2021 * Uniquely identifies of an entity instance in a particular Session by identifier.
2122 * 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() {
117118
118119 @ Override
119120 public String toString () {
120- return "EntityKey" + MessageHelper . infoString ( this .persister , identifier , persister .getFactory () );
121+ return "EntityKey" + infoString ( this .persister , identifier , persister .getFactory () );
121122 }
122123
123124 /**
Original file line number Diff line number Diff line change @@ -87,17 +87,15 @@ public static String infoString(
8787 info .append ( " with null id" );
8888 }
8989 else {
90- info .append ( " with id '" ). append ( id ). append ( "'" ) ;
90+ info .append ( " with id '" );
9191 if ( idType == null ) {
9292 info .append ( id );
9393 }
94+ else if ( factory != null ) {
95+ info .append ( idType .toLoggableString ( id , factory ) );
96+ }
9497 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>" );
10199 }
102100 info .append ( "'" );
103101 }
You can’t perform that action at this time.
0 commit comments