title: Fetch database records using hibernate without using Primary Key
body: <p>I want to fetch records from database without the primary key, for a table that i have created. Here is the model class for it. </p>
  
  <pre><code>@Entity
  @Table(name = "DOCTORS_INFORMATION")
   public class DoctorInformation {
  
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  @Column(name = "DOCTOR_ID")
  private int ID;
  
  @Column(name = "FIRST_NAME")
  private String firstName;
  
  @Column(name = "LAST_NAME")
  private String lastName;
  
  @Column(name = "ADDRESS_LINE1")
  private String addressLine1;
  
  @ManyToOne(cascade = CascadeType.ALL)
  @JoinColumn(name = "CITY")
  private Location location;
  //along with setters and getters
  </code></pre>
  
  <p>It is very difficult to remember the Doctor_Id for every doctor, and logically First_Name or anything cannot be made a primary key. All the tutorials and lecture videos that i have gone through fetch records using <strong>session.get</strong> where session is an object of class Session. In the source code of Session class all the overloaded methods of <code>get</code> mandatory take id as a parameter...
  Is their a workaround for the above problem?</p>