I am getting the date (SettlementDate) in form of string in a method parameter as shown in the below method
public List<abc> eee(Long Id,
String sfsdf, boolean dfds,
String SettlementDate,
) {
now I am applying criteria as shown below but in pojo to which I am applying criteria IN THAT POJO THAT FIELD (SettlementDate) is of Date type as shown below
class ddd
{
private Date settlementDate;
}
below is the criteria implemetation
Criteria query = session.createCriteria(ddd.class);
query.add(Restrictions.eq("Id", Id));
query.add(Restrictions.eq("sfsdf", sfsdf));
query.add(Restrictions.eq("settlementDate", SettlementDate );
ultimately in database i want to store the date in this format 22.07.2016 00:00:00
now please advise how how do i set this value in criteria as rite now I am getting class cast exception in the below line
query.add(Restrictions.eq("settlementDate", SettlementDate );
which clearly proves that date of string type is not converted in date format ( 22.07.2016 00:00:00) folks , if I have to use simple date format then please advise how to use that in this situation ,Thanks