title: How do I join two tables in hibernate and Spring
body: <p>How do I join two tables in hibernate and Spring. below is my suto java code and I need to do a join on objectA where the name field is equal to the name field in objectB but I am going to be searching on ObjectA ID field but I need returned. ObjectA ID, ObjectA Name, ObjectA Regin, ObjectB Address.</p>
  
  <pre><code>//
  // CLASS OBJECT A
  //
  @Entity
  @Table(name = "tableA")
  public class ObjectA {
  
      @Id
      @Column(name = "id")
      private String id; 
  
      @Column(name = "name")
      private String name; 
  
      @Column(name = "region")
      private String region; 
  
  }
  
  //
  // CLASS OBJECT B
  //
  @Entity
  @Table(name = "tableB")
  public class ObjectB {
  
      @Id
      @Column(name = "id")
      private String id; 
  
      @Column(name = "name")
      private String name; 
  
      @Column(name = "address")
      private String address; 
  
  }
  </code></pre>
  
  <p>can someone please tell me how to do this within the java code.</p>