Hi all,
I have 2 classes - Distributor{ Date signUpDate; } and Transactions { int sponsorId; Date orderDate; //which has an instance of member class }
This is wat i have written to compare orderDate >= signUpDate and orderDate <= signUpDate+31
Criteria crit = session.createCriteria(Transactions.class,"ord"); crit.add(Restrictions.eq("ord.sponsorId", sponsorId)); crit.add(Restrictions.ge("ord.orderDate", "ord.distributor.signupDate")); crit.add(Restrictions.le("ord.orderDate", "ord.distributor.signupDate"+31));
I know this is wrong since i ma getting classcastException, can someone please tell correct way of doing this.
Thanks.
|