title: java.sql.SQLException: ORA-01747: invalid user.table.column, table.column, or column specification
body: <p>I am getting the error </p>
  
  <pre><code>java.sql.SQLException: ORA-01747: invalid user.table.column, table.column, or column specification
  </code></pre>
  
  <p>My Piece of code that is returning this error is this:</p>
  
  <pre><code>public boolean checkAttendance(String userid,String currentdate){
          boolean status=false;
          List attendanceList=new ArrayList();
          Session session = getSessionFactory().openSession();
          try {
              Transaction tx = session.beginTransaction();
              String hql = "select userid from Attendance where userid='"+ userid +"' and date='"+currentdate+"'";
              Query query = session.createQuery(hql); 
              attendanceList = (ArrayList) query.list();  //This Line returning the error
              if(attendanceList.size()&gt;0)
              {
                  status=true;
              }
              tx.commit();
          } catch (Exception e) {
              e.printStackTrace();
          } finally {
              session.close();
          }       
  
          return status;
      }
  </code></pre>
  
  <p>I have tried to enable view sql in my Context.xml file </p>
  
  <pre><code>&lt;property name="hibernateProperties"&gt;
              &lt;value&gt;
                  hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
                  hibernate.show_sql=true;
              &lt;/value&gt;
          &lt;/property&gt;
  </code></pre>
  
  <p>I cannot see the sql getting executed and I do not Know why this error is coming because my table and Fields are correct. Please Help. Am using Oracle 11g</p>