Hi All,
In my application I am using 2 different data bases .
1.SQL Server and 2.Oracle.
So in hibernate.properties file i have written the mapping for both the databases.
So if i want to use SQL Server i am uncommenting the related and mapping and commenting the Oracle mapping.
I have written all the queries using Hibernate Query Language.
The problem is when i am performing "date based search"...
I made to convert the date column in the database using todate() in oracle and other date function in SQL Server. for this reason every time if i change the type of the database i used , i need to change the particular query.
Ex:
select new AbcVO(avo.sno) from AbcVO avo where date(avo.joindate)="mydate"
in the above query i am using the date() function to convert the data base date time value into date. So this date function is changing with respect to the datbase.
So how the hibernate supports both the queries without using any different date functions.
|