title: HQL with one-to-many relationship is giving "ORA-00936: missing expression" exception
body: <p>I have 2 tables with One-To-Many relationship as per following:</p>
  
  <p><a href="https://i.stack.imgur.com/QcanK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QcanK.png" alt="Table Relationship"></a></p>
  
  <p>My entity classes and hbm configurations are as per following:</p>
  
  <p><strong>AuditDetail.java</strong></p>
  
  <pre><code>public class AuditDetail implements Serializable {
  
      private static final long serialVersionUID = 1L;
      private String auditId;
      private Timestamp startTime;
      private Timestamp endTime;
      Set auditParameterDataSet;
  
      public Set getAuditParameterDataSet() {
          return auditParameterDataSet;
      }
      public void setAuditParameterDataSet(Set auditParameterDataSet) {
          this.auditParameterDataSet = auditParameterDataSet;
      }
      public String getAuditId() {
          return auditId;
      }
      public void setAuditId(String auditId) {
          this.auditId = auditId;
      }
      public void setStartTime(Timestamp startTime) {
          this.startTime = startTime;
      }
      public Timestamp getEndTime() {
          return  endTime;        
      }
      public void setEndTime(Timestamp endTime) {
          this.endTime = endTime;
      }   
  }
  </code></pre>
  
  <p><strong>AuditDetail.hbm.xml</strong></p>
  
  <pre><code>&lt;hibernate-mapping&gt;
  
      &lt;class name="com.test.AuditDetail" table="AUDITDETAIL" &gt;          
  
          &lt;id name="auditId" column="AUDITID" type="string" /&gt;
  
           &lt;property name="startTime" type="java.sql.Timestamp"&gt;
                &lt;column name="STARTTIME" sql-type="VARCHAR2(50)" /&gt;
           &lt;/property&gt;
  
           &lt;property name="endTime" type="java.sql.Timestamp"&gt;
                &lt;column name="ENDTIME" sql-type="VARCHAR2(50)" /&gt;
           &lt;/property&gt;
  
          &lt;set name="auditParameterDataSet" cascade="all,delete-orphan" lazy="true" inverse="true"&gt;
              &lt;key&gt;
                  &lt;column name="AUDITID"/&gt;
              &lt;/key&gt;
              &lt;one-to-many class="com.test.AuditParameter" /&gt;
          &lt;/set&gt;
  
      &lt;/class&gt;
  
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p><strong>AuditParameter.java</strong></p>
  
  <pre><code>public class AuditParameter {
  
      private String auditId ;
      private String parameterId;
      private String fieldName ;
      private AuditDetail auditDetail;
  
      public String getAuditId() {
          return auditId;
      }
      public void setAuditId(String auditId) {
          this.auditId = auditId;
      }
      public String getParameterId() {
          return parameterId;
      }
      public void setParameterId(String parameterId) {
          this.parameterId = parameterId;
      }
      public String getFieldName() {
          return fieldName;
      }
      public void setFieldName(String fieldName) {
          this.fieldName = fieldName;
      }
      public AuditDetail auditDetail() {
          return auditDetail;
      }
      public void setAuditDetail(AuditDetail auditDetail) {
          this.auditDetail = auditDetail;
      }
  
  }
  </code></pre>
  
  <p><strong>AuditParameter.hbm.xml</strong></p>
  
  <pre><code>&lt;hibernate-mapping&gt;
  
      &lt;class name="com.test.AuditParameter" table="AUDITPARAMETER" &gt;          
  
           &lt;id name="parameterId" type="string"&gt;
                &lt;column name="PARAMETERID" sql-type="VARCHAR2(50)"  /&gt;
          &lt;/id&gt;
  
          &lt;many-to-one name="auditDetail" class="com.test.AuditDetail" column="AUDITID" insert="false" update="false" lazy="false"&gt;
          &lt;/many-to-one&gt;
  
          &lt;property name="auditId" type="string"&gt;
                &lt;column name="AUDITID" sql-type="VARCHAR2(50)" not-null="false" /&gt;
          &lt;/property&gt;
  
          &lt;property name="fieldName" type="string"&gt;
                &lt;column name="FIELDNAME" sql-type="VARCHAR2(50)" /&gt;
          &lt;/property&gt;
  
  
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>My hql query is a per following:</p>
  
  <pre><code>select a.auditId, a.startTime, a.endTime, a.auditParameterDataSet from AuditDetail a;
  </code></pre>
  
  <p>But when I execute this query, it gives me following error:</p>
  
  <blockquote>
    <p>ORA-00936: missing expression</p>
  </blockquote>
  
  <p>Following is my console output of query fired.</p>
  
  <pre><code>select au0_.AUDITID as col_0_0_, au0_.STARTTIME as col_1_0_, au0_.ENDTIME as col_2_0_, . as col_3_0_ 
  from AUDITDETAIL au0_ inner join AUDITPARAMETER auditparam4_ on au0_.AUDITID=auditparam4_.AUDITID
  </code></pre>
  
  <p>As per this output we can see that hibernate is not generating column name for a.auditParameterDataSet. Why this is happening? Where I am doing wrong?</p>