Uploaded image for project: 'Hibernate ORM'
  1. HHH-10780

Provide a PrimitiveByteArrayTypeDescriptor toString implementation

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects versions: None
    • Fix versions: 5.2.0, 5.1.1
    • Components: None
    • Last commented by a user?:
      true
    • Sprint:

      Description

      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 default java.lang.Object implementation, which is not very useful in this case.

      We should provide a better toString() implementation for this.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: