title: Hibernate Criteria: nested exception is org.hibernate.QueryException: could not resolve property:
body: <p>I'm trying get all data from isssue table that matches with projectname and Issue Id. I'm getting following error. please help me.</p>
  
  <p>Tables
  <strong>Project</strong>
  ProjectID
  ProjectName</p>
  
  <p><strong>Issue</strong>
  issueID
  identifier
  sourceStatus
  title
  severity
  description</p>
  
  <p><strong>Project.java</strong></p>
  
  <pre><code>@Entity
      @Table(name="project")
      public class Project implements Serializable {
  
          private static final long serialVersionUID = 2457316470957669814L;
          @Id
          @GeneratedValue(strategy=GenerationType.AUTO)
          @Column(name="ProjectId")
          private Integer projectId;
  
          @Column(name="projectname")
          private String projectName;
  
          @OneToMany(fetch=FetchType.EAGER,cascade=CascadeType.ALL,mappedBy = "project")
          private List&lt;Issue&gt; issue;
  
          //getters and setters
      }
  </code></pre>
  
  <p><strong>Issue.java</strong></p>
  
  <pre><code>@Entity
  @Table(name="issue")
  public class Issue implements Serializable{
  
      private static final long serialVersionUID = 1L;
  
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      @Column(name="Id")
      private Integer Id;
  
      @Column(name="identifier")
      private String identifier;
  
      @Column(name="sourcestatus")
      private String sourceStatus;
  
      @Column(name="severity")
      private Integer severity;
  
      @Column(name="title")
      private String title;
  
      @Column(name="description")
      private String description;
  
      @ManyToOne
      @JoinColumn(name ="ProjectId")
      private Project project;
  
  //getters and setters
    }
  </code></pre>
  
  <p><strong>IssueDAOImpl.java</strong></p>
  
  <pre><code>public List&lt;Issue&gt; getAllIssue(String identifier,String projectName) {
      Criteria criteria = sessionFactory.getCurrentSession().createCriteria(Issue.class);
      criteria.createAlias("Project", "Prj");
      criteria.add(Restrictions.eq("identifier",identifier));
      criteria.add(Restrictions.eq("Prj.projectName",projectName));
  
      List&lt;Issue&gt; list=criteria.list();
      return list;
  }
  </code></pre>
  
  <p><strong>CONSOLE</strong></p>
  
  <pre><code>SEVERE: Servlet.service() for servlet [dcm] in context with path [/SearchTool] threw exception [Request processing failed; nested exception is org.hibernate.QueryException: could not resolve property: Project of: com.dcm.search.bean.Issue] with root cause
  org.hibernate.QueryException: could not resolve property: Project of: com.dcm.search.bean.Issue
  </code></pre>