title: JPA Annotations - How to retrieve a single value from a different table than the current object?
body: <p>How do you map a single value from a column in another table to the current object?</p>
  
  <p>Example:</p>
  
  <pre><code>class Foo {
      @Id
      @Column(name="FOO_ID")
      private String fooId;
  
      @Column(name="FOO_A")
      private String fooA;
  
      //Column to map to another table?
      //is a one to one mapping - but don't want a separate object for this.
      private String barCode;
  }
  </code></pre>
  
  <p>Table: <code>Fields</code></p>
  
  <p>Foo: <code>FOO_ID, FOO_A</code></p>
  
  <p>Bar: <code>FOO_ID, BAR_CODE</code></p>
  
  <p>How do I retrieve the <code>BAR_CODE</code> field without creating a separate object (or a secondary table) using <code>JPA annotations</code>?</p>