Provide a PrimitiveByteArrayTypeDescriptor toString implementation
Description
Activity
Show:
Former user June 13, 2016 at 8:29 PM
Closing after applying label.
Former user June 13, 2016 at 8:29 PM
Reopening to apply label.
Vlad Mihalcea May 31, 2016 at 9:54 AM
@Former user Would you like to add this to 5.0 too?
Vlad Mihalcea May 31, 2016 at 9:31 AM
Add a fix starting from the PR suggestions.
Currently, if we have the following entity:
@Entity(name = "Image") public static class Image { @Id private Long id; @Column(name = "content") private byte[] content; }
When we try to persist and entity, the following log output is generated:
10:34:58,722 DEBUG SQL:92 - insert into Image (content, id) values (?, ?) 10:34:58,723 TRACE BasicBinder:65 - binding parameter [1] as [VARBINARY] - [[B@3f5478c8] 10:34:58,724 TRACE BasicBinder:65 - binding parameter [2] as [BIGINT] - [1]
The
VARBINARY
logged value is using the defaultjava.lang.Object
implementation, which is not very useful in this case.We should provide a better toString() implementation for this.