Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html
Quote:
I want to retreive data based on date range i.e From date and To Date in the input form.
There is actually a Processing Business Date colum in the database table whose type is Date.This processing Business date should fall in between From Date and To Date .
My Process.config.hbm.xml file
<class name='ProcessHist' table='PROCESS_INPUT' >
<composite-id>
<key-property name='lookUpID' column="LKUP_ID"/>
</composite-id>
<property name='trgtSyst' column='TRGT_SYST' type="java.lang.String"/>
<property name='prcsBusDate' column='PRCS_BUSN_DATE' type="java.sql.Timestamp" />
<property name='prcsStatus' column='PRCS_STAT' type="java.lang.String" />
<property name='activeFlag' column='ACTV_FLAG' type="java.lang.String" />
<property name='userId' column='USER_ID' type="java.lang.String" />
<property name='modfDate' column='MODF_DATE' type="java.sql.Timestamp" />
<property name='modfId' column='MODF_ID' type="java.lang.String" />
<property name='makeTime' column='ENTR_DATE' type="java.sql.Timestamp" />
<property name='userRemarks' column='USER_REMR' type="java.lang.String" />
</class>
My Query looks like
<query name="ProcessHist.getRecords4Update">
<![CDATA[
from ProcessHist as hist where
('%' = :trgtSyst or upper(hist.trgtSyst) like :trgtSyst) and
(hist.prcsBusDate between (('%' = :frmDate) and ('%' = :toDate) ) and ('%' = :activeFlag or hist.activeFlag =:activeFlag ) and
hist.prcsStatus='Request Submitted'
order by hist.prcsBusDate desc
]]>
</query>
I am getting an exception could not execute the query on the screen.
Can anyone please help me in correcting the query?
Thanks in advance