title: Hibernate generating bad syntax sql
body: <p>There are two tables: bb_players and bb_player_skills.
  player skills table has one to one relation with bb_players, and also foreign key to bb_players.</p>
  
  <p>Error happens at executing this code:</p>
  
  <pre><code>Query q = em.createNamedQuery(PlayerSkill.DELETE_SKILL_BY_PLAYER_ID);
  q.setParameter("playerID", playerID);
  q.executeUpdate();
  </code></pre>
  
  <p>The named query is:</p>
  
  <pre><code> @NamedQuery(name = PlayerSkill.DELETE_SKILL_BY_PLAYER_ID, query = "DELETE FROM   PlayerSkill s " +
   " WHERE s.player.id = :playerID")
  </code></pre>
  
  <p>The error from postgresql logs is:</p>
  
  <pre><code>ERROR,42601,"syntax error at or near ""cross""",,,,,, 
   "delete from bb_player_skills cross join bb_players player1_ where id=$1",30,,""
  </code></pre>
  
  <p>Is my named query wrong and how should I rewrite it?</p>