title: JPQL Query generates Incorrect syntax near 'cross' for Sybase
body: <p>I have a named query that is generating cross joins for the calls to my Sybase 15 database. I think I need to reformat my query to use joins but cannot figure out the required syntax. The objects and their mappings are as below</p>
  
  <h1>WorkflowDef</h1>
  
  <pre><code>@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
  @JoinColumn(name = "workflow_type_id", nullable = false)
  private WorkflowType workflowType;
  </code></pre>
  
  <h1>WorkflowInstance</h1>
  
  <pre><code>@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
  @Fetch(FetchMode.SELECT)
  @JoinColumn(name = "workflow_def_id", nullable = false, updatable = false)
  private WorkflowDef workflowDef;
  </code></pre>
  
  <p>and my named query is </p>
  
  <pre><code>@NamedQuery(name = "WorkflowInstance.hasStatus", query = "SELECT wi.id FROM WorkflowInstance wi WHERE wi.deal.id = :dealId AND wi.workflowDef.workflowType.systemKey = :wfTypeName AND wi.status IN (:statuses)")
  </code></pre>
  
  <p>this throws the error</p>
  
  <pre><code>2015-01-26 16:27:24,237 DEBUG [http-8080-3] util.SQLStatementLogger - 
  select
      workflowin0_.wf_instance_id as col_0_0_ 
  from
      tbl_wf_instance workflowin0_ cross 
  join
      tbl_workflow_def workflowde1_ cross 
  join
      tbl_lkp_workflow_type workflowty2_ 
  where
      workflowin0_.workflow_def_id=workflowde1_.workflow_def_id 
      and workflowde1_.workflow_type_id=workflowty2_.workflow_type_id 
      and workflowin0_.deal_id=? 
      and workflowty2_.name=? 
      and (
          workflowin0_.status in (
              ?
          )
      )
  </code></pre>
  
  <p>2015-01-26 16:27:24,238 TRACE [http-8080-3] type.NullableType - binding '60001972' to parameter: 1
  2015-01-26 16:27:24,239 TRACE [http-8080-3] type.NullableType - binding 'CREDIT' to parameter: 2
  2015-01-26 16:27:24,240 DEBUG [http-8080-3] type.EnumType - Binding '2' to parameter: 3
  2015-01-26 16:27:24,277 WARN [http-8080-3] util.JDBCExceptionReporter - SQL Error: 102, SQLState: 42000
  2015-01-26 16:27:24,278 ERROR [http-8080-3] util.JDBCExceptionReporter - Incorrect syntax near 'cross'. </p>
  
  <p>I am using the following in my persistence unit</p>
  
  <pre><code>&lt;property name="jpaVendorAdapter"&gt;
          &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt;
              &lt;property name="showSql" value="false"/&gt;
              &lt;property name="databasePlatform" value="org.hibernate.dialect.SybaseASE15Dialect"/&gt;
          &lt;/bean&gt;
      &lt;/property&gt;
  </code></pre>
  
  <p>Can anyone advise where I am going wrong?</p>