title: JPA annotations combining one column to another table
body: <p>I have "Table A." Inside Table A there is a "superId" column. It matches the "id" column in "Table B," though this data is not bound to each other. However each "superId" number in Table A is supposed to represent the "id" number in Table B. Also, there is a "name" column in Table B that I want to show on my website when I load it instead of the "superId" number. How would I bind the "name" in Table B to "id" in Table A?</p>
  
  <p>public class A: Part of the code involving the Super_Id for the database for Table A is:</p>
  
  <pre><code>'public class A{
  
  @Column(name = "Super_Id")
  @Basic(optional = true)
  @Expose
  private Short superId;
  
  public Short superId() {
      return superId;
  }
  
  public void setSuperId(Short superId) {
      this.superId = superId;
  }`
  
  'public class B{
   @Id
   @Column(name = "id")
   @GeneratedValue(strategy = GenerationType.IDENTITY)
   private Long id;
  
   @Column(name = "name")
   private String name;
  
   public void setName(String id) {
      this.name = id == null ? null : id.trim();
  }
  
  public boolean equals(Object obj)
  {
      class b = (Class)obj;
      if(b == null)
          return false;
      if(b.getName().equals(this.name))
          return true;
      return false;
  }
  </code></pre>