title: Hibernate selecting queries in Java
body: <p>I'm attempting to use Jackson/Hibernate/SQL/Java to carry out select.</p>
  
  <p>Here is what I am trying:</p>
  
  <pre><code> Transaction tx = null;
      List&lt;Note&gt; list = null;
  
      try {
          tx = dbSession.beginTransaction();
          Query query = dbSession.createQuery("select Note from notes where name= :nameQ and university= :universityQ " +
                  "and professor= :professorQ");
          query.setParameter("nameQ", "ONE");
          query.setParameter("universityQ", "TWO");
          list = query.list();
          tx.commit();
          return new FileInfo(Integer.toString(list.size()), fileName);
      } 
  </code></pre>
  
  <p>But I am getting a nullptr exception, which obviously means something is wrong in the query. What is wrong with this? The note class is:</p>
  
  <pre><code>@Table(name="notes")
  @Entity
  public class Note {
      @Id
      @GeneratedValue(strategy= GenerationType.IDENTITY)
      @Column(name="id")
      private int id;
  
      @Column(name="name")
      private String name;
  
      @Column(name="course")
      private String course;
  
      @Column(name="university")
      private String university;
  
      @Column(name="date")
      private String date;
  
      @Column(name="professor")
      private String professor;
  
      @Column(name="semester")
      private String semester;
  
      @Column(name="url")
      private String url;
  
      public Note(){
  
      }
  
      public Note(String name, String course, String university, String date, String professor, String semester) {
          this.name = name;
          this.course = course;
          this.university = university;
          this.date = date;
          this.professor = professor;
          this.semester = semester;
      }
  
    //Usual setters/getters
  </code></pre>
  
  <p>Can you help me out?</p>