• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQLRestrictions

 
java bangalore
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

this is my criteria query


Criteria crit = session.createCriteria(ScOrdertransactions.class,"ord");

Criteria criterion = crit.createCriteria("distributor");
criterion.add(Restrictions.ge("signupDate", beginDate));
criterion.add(Restrictions.le("signupDate", endDate));

criterion.add(Property.forName("ord.orderDate").geProperty("signupDate"));
criterion.add(Restrictions.sqlRestriction("{alias}.orderDate >= (signupDate + ?) ", new Integer(31), Hibernate.INTEGER));

i need to check if ord.orderDate <= distributor.signUpDate+31 .....31 days added to sign up date.

This is erroring out....i know syntax is wrong...can somebody please help...

Thanks
 
Maneesh Godbole
Saloon Keeper
Posts: 11327
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java bangalore wrote:

As you had been requested twice before already, you need to change your display name to comply to the Naming Policy. Please note, this is not optional, and non compliance might lead to your account getting suspended.
You are expected to change your display name before your next post.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic