• 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

Hibernate select Oracle

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

I need something really simple, but need your help to do this

I am using Hibernate with Oracle Database, and I am performing a Full query using "select b from Biossimilar_Entity b" as you can see bellow


But I need two things, I need to apply to filters using Date Field;


First:

I need to get this list ordered by date , from the first to last.. Examplo: 01012015 then 01022015, then 01032015, etc. DD/MM/YYYY

Second

I need to get same list , but I only need the last 12 months.... when I get this list today 27/07/2016 , i will need all months starting in 01/07/2015

Could someone help me please?
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are these two different queries, or are you changing the existing one?

Have you tried an ORDER BY?

For the filter, have you added a WHERE date_field > :12 months ago date?
 
reply
    Bookmark Topic Watch Topic
  • New Topic