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

    Path expected for join!

    meselfe

      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);
      query.setMaxResults(max);
      query.setFirstResult(index);
      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?