• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate select Oracle

 
Nelson Gomes
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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?
 
Dave Tolls
Ranch Hand
Posts: 2112
16
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic