title: Using JPA join via one column and return another one
body: <p>I have table with two columns:</p>
  
  <pre><code>@Entity
  @Table(name = "documents")
  public class Document {
      @Id
      @Column(name = "key")
      public String key;
      @Lob
      @Column(name = "value")
      public byte[] value;
      ....some more data...
  }
  </code></pre>
  
  <p>And I have another table, with some field where I have a reference to the Document table, via key column reference:</p>
  
  <pre><code>@Entity
  @Table(name = "table")
  public class Table {
       ...some values and id...
       @Nullable
       @ManyToOne(fetch = FetchType.LAZY, targetEntity = Document.class)
       @JoinColumn(name = "some_document_id", referencedColumnName = "key",
               foreignKey = @ForeignKey(name = "document_id_fk"))
       @Convert(converter = ByteArrayToStringConverter.class)
       public String documentValue; //join documents by key column and return value column
  }
  </code></pre>
  
  <p>What I want, is to fetch not the whole <code>Document</code> with all fields when joining it from this table, but to fetch only one column named <code>value</code>, and then convert it from <code>byte[]</code> to <code>String</code>.</p>
  
  <p>I understand that I can just call getter from java code, but I am curious if that is possible by Jpa/Hibernate API?</p>