Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
2.8
Mapping documents:
<hibernate-mapping package="com.talisen.lbwebpo.model">
<class name="RfqData" table="RFQ_DATA">
<id name="rfqDataId" column="RFQ_DATA_ID" type="integer">
<generator class="native"/>
</id>
<property name="supplierCode" column="SUPPLIER_CODE" type="string" />
<property name="dateGenerated" column="DATE_GENERATED" type="date" not-null="true" />
<property name="extension" column="EXTENSION" type="string" not-null="true" />
<property name="status" column="STATUS" type="string" not-null="true" />
<property name="type" column="TYPE" type="string" not-null="true" />
<property name="username" column="USERNAME" type="string" not-null="true" />
<property name="requested" column="REQUESTED" type="date" />
<property name="returned" column="RETURNED" type="date" />
<property name="filename" column="FILENAME" type="string" />
<many-to-one name="po" column="PARENT_PO_ID" class="Po" not-null="true" />
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
count = (Integer) session
.createQuery(
"select count(*) from RfqData rd where rd.parentPoId = "
+ parentPoId + " and rd.returned is null").uniqueResult();
tx.commit();
Full stack trace of any exception that occurs:
javax.servlet.ServletException: net.sf.hibernate.QueryException: in expected: rd [select count(*) from RfqData rd where rd.parentPoId = 2345011 and rd.returned is null]
Name and version of the database you are using:
Oracle 9i
The generated SQL (show_sql=true):
None. It can't parse out the HQL. See above.