title: Hibernate runtime exception SQLGrammarException
body: <p>Hibernate gives me a run time error to the following query.It's saying that there is a syntax error.</p>
  <pre><code>ERROR: Syntax error: Encountered &quot;,&quot; at line 1, column 16.
  </code></pre>
  <p>Note that transaction handling handled at the service layer that's why session related lines are not in the code.</p>
  <pre><code> String hql = &quot;UPDATE Lecturer L set L.id=:id,L.name=:name,L.department=:department,L.center=:center,L.facultyType=:facultyType,L.rank=:rank,L.level=:level,L.building.id=:buildingId,L.building.building=:building where L.id=:prevId&quot;;
  
          Query query = session.createQuery(hql);
          query.setParameter(&quot;id&quot;, lecturerDTO.getId());
          query.setParameter(&quot;name&quot;, lecturerDTO.getName());
          query.setParameter(&quot;department&quot;, lecturerDTO.getDepartment());
          query.setParameter(&quot;center&quot;, lecturerDTO.getCenter());
  
          query.setParameter(&quot;facultyType&quot;, lecturerDTO.getFacultyType());
          query.setParameter(&quot;rank&quot;, lecturerDTO.getRank());
          query.setParameter(&quot;level&quot;, lecturerDTO.getLevel());
          query.setParameter(&quot;buildingId&quot;, lecturerDTO.getBuildingDTO().getId());
          query.setParameter(&quot;building&quot;, lecturerDTO.getBuildingDTO().getBuilding());
          query.setParameter(&quot;prevId&quot;, prevId);
          query.executeUpdate();
  
  </code></pre>