Monday, 2 September 2013

hibernate hql like criteria on date type field

hibernate hql like criteria on date type field

I have a project based on hibernate, my database is sql server, I have a
need to search on a table(SalesRepsMaster) irrespective of any field on
like criteria. There is one date field, so on like criteria this fails, I
checked in sql query that works fine. I can not use any sql, I have to use
proper hql, can anyone please tell me the hql of bellow mentioned sql? or
hql corresponds to CONVERT(VARCHAR(30),lastLoginDate,102)?
Select * From SalesRepsMaster WHERE CONVERT(VARCHAR(30),lastLoginDate,102)
like '%2013%'
thanks in advance.

No comments:

Post a Comment