HQL Error "Could not resolve property"
<p>having some trouble using HQL to pull entities from my Oracle DB.</p>

<p>Here is the code from my DAO</p>

<pre><code>public ClientProject getClientProject(Client client, Product product) {
    ClientProject clientProject = null;
    Session session = factory.openSession();
    String name = client.getClientName();
    String id = "" + product.getProductId();
    String hql= "from ClientProject as cp where cp.client.name = :name and cp.product.id = :id";
    try {
        session.beginTransaction();
        Query query = session.createQuery(hql);
        query.setParameter("name", "%"+name+"%");
        query.setParameter("id", "%"+id+"%");

    } finally {
        session.close();
    }

    return clientProject;
}
</code></pre>

<p>Here is the code for ClientProject</p>

<pre><code>@Entity
@Table (name="client_project")
@SequenceGenerator(name="seq_client_project",sequenceName="****.SEQ_CLIENT_PROJECT", allocationSize=1, initialValue=1)
public class ClientProject {

//Fields
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="seq_client_project")
@Column(name="CLIENT_PROJECT_ID")
private int id;
@ManyToOne(fetch=FetchType.EAGER)
@JoinColumn(name="client_id")
private Client client;
@OneToOne(cascade=CascadeType.ALL)
@JoinColumn(name="product_id")
private Product product;
@OneToMany(mappedBy="clientProject")
private Set&lt;Mod&gt; clientProjectMod;
@Column(name="PROJECT_CODE")
private String projectCode;
</code></pre>

<p>Here is the code for the Client class</p>

<pre><code>@Entity
@Table (name="client")
@SequenceGenerator(name="seq_client",sequenceName="****.SEQ_CLIENT", allocationSize=1, initialValue=1)
public class Client {

//Fields
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="seq_client")
@Column(name="CLIENT_ID")
private int id;
@Column(name="CLIENT_NAME")
private String clientName;
@Column(name="CLIENT_CODE")
private String clientCode;
@OneToMany(mappedBy="client")
private Set&lt;ClientProject&gt; clientProjects;
</code></pre>

<p>And here is the error message I'm getting..</p>

<pre><code>WARNING: #{newBean.handleGenerateForm}: org.hibernate.QueryException: could not resolve property: name of: com.manh.entries.Client [from com.manh.entries.ClientProject as cp where cp.client.name = :name and cp.product.id = :id] javax.faces.FacesException: #{newBean.handleGenerateForm}: org.hibernate.QueryException: could not resolve property: name of: com.manh.entries.Client [from com.manh.entries.ClientProject as cp where cp.client.name = :name and cp.product.id = :id]
</code></pre>

<p>Any ideas? I'm guessing I'm just screwing up part of the HQL Query... </p>

<p>Thanks in advance!</p>