title: SQL Error: 933, SQLState: 42000 and ORA-00933: SQL command not properly ended
body: <p>I'm using Hibernate for database access.  I'm using the following query in my code to fetch the data I need:</p>
  
  <pre><code>SELECT proasset
  FROM com.company.claims.participant.AbstractBeneficiary bene
  JOIN bene.approvals approval
  JOIN bene.proassetkey proasset
  join proasset.relatedparties proassetparties
  WHERE approval.user_dt &gt; :currentDate
  AND approval.user_type = :userType
  </code></pre>
  
  <p>I'm using it as <code>query</code> in the following:</p>
  
  <pre><code>Query q = this.getSessionFactory().getCurrentSession().createSQLQuery(query.toString())
  q.setDate("currentDate", new Date());
  q.setString("userType", APPROVER_USER_TYPE);
  List&lt;ProAsset&gt; proassets = q.list();
  </code></pre>
  
  <p>However, I encounter the following when trying to run it:</p>
  
  <pre><code>SQL Error: 933, SQLState: 42000
  ORA-00933: SQL command not properly ended
  </code></pre>
  
  <p>If it matters, the query is being constructed using a <code>StringBuilder</code> and it uses <code>\n</code> to break the lines</p>
  
  <p>Any thoughts on the problem?</p>