Is it correct to use to_date() in hibernate if date is stored as string like (132011) in Database?
问题 I have a table "Products(id, name, productionDate)" in Oracle database. "date" column is defined as String and it has value like "131120" (1st two digits for year, 2nd two digits for year & final two digits for date). I need a sorted output based on date using Hibernate. SQL query to do this is like the following: select * from products order by to_date(productionDate, 'YYMMDD') desc; This sql query is fine when I try from command prompt. But when I tried to use this query using Hibernate, I