• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SQLRestrictions

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
What's a year in metric? Do you know this metric stuff tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic