Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Hibernate to do Oracle query with to_date function

 
Robert Wiscup
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Does anyone have an example of doing an HQL Query that hits an Oracle DB using the Oracle to_date function? I'd rather NOT use native SQL. Or, if not, can someone suggest how to do this type of query?




Thanks,

Rob
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to use an Oracle specific function your only option is a SQL query. HQL does support the between keyword though so if you treat your date as, well, dates you don't need the function.
 
Robert Wiscup
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

Thanks for the reply . . .

Ok, I can execute my native SQL Query and get my results as an array of "generic" objects . . . but now I want to convert them to an array of objects my specific type of bean . . . I'm working on this . . . can you suggest an approach?

Thanks,

Rob
 
Robert Wiscup
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Paul,

I've solved this problem so please disregard the previous post . . . everything is working properly now . . .

Thanks very much for your help . . .

Rob
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic