title: Hibernate Converter Causes SQLException
body: <p>In my Hibernate entity class I have a Boolean that I want to be true for certain characters in a column of <code>VARCHAR2(1)</code>. But my code causes a <code>SQLException: Fail to convert to internal representation</code>. Can someone see what I'm doing wrong? My code is as follows:</p>
  
  <p>In my entity I have:</p>
  
  <pre><code>...
  
      private Boolean flag;
  
      @Column(length = 1, name = "FLAG")
      @Convert(converter = FlagToBooleanConverter.class)
      public Boolean getFlag()
      {
          return flag;
      }
  
      void setFlag(Boolean flag)
      {
          this.flag = flag;
      }
  
  ...
  
  @Converter
  class FlagToBooleanConverter implements AttributeConverter&lt;Boolean, String&gt;
  {
      @Override
      public Boolean convertToEntityAttribute(String value)
      {
          return (value.equals("X") || value.equals("Y"));
      }
  
      @Override
      public Boolean convertToDatabaseColumn(String value)
      {
          // My class should only read from the DB so I don't need this but I have to override it
          return null;
      }
  }
  </code></pre>
  
  <p>UPDATE: Feels kind of hacky, but at the moment, to get the job down I've been using:</p>
  
  <pre><code>    private String flag;
  
      @Column(length = 1, name = "FLAG")
      String getFlag()
      {
          return flag;
      }
  
      void setFlag(String flag)
      {
          this.flag = flag;
      }
  
      @Transient
      public Boolean isFlag()
      {
          return (value.equals("X") || value.equals("Y"));
      }
  </code></pre>