2 Replies Latest reply: Oct 3, 2009 11:43 AM by billson chew RSS

Path expected for join!

Scale It Newbie

Why am i getting this exception:

javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.hql.ast.QuerySyntaxException: Path expected for join! [select p from dk.simpletime.model.entity.Project as p join Task as t where p.id = :projectid]

..when performing the query:
String queryStr = "select p from Project as p join Task as t where p.id = :projectid";
Query query = manager.createQuery(queryStr);
query.setParameter("projectid", projectId);
List tasks = query.getResultList();

Theres a @OneToMany relation from Project to Task.

Can any1 help?

Also what would be the query to select all Tasks given a Project?