GeeCON Prague 2014*
The moose likes Object Relational Mapping and the fly likes How to add year in a given date using Hibernate Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How to add year in a given date using Hibernate Query" Watch "How to add year in a given date using Hibernate Query" New topic
Author

How to add year in a given date using Hibernate Query

JavaSeeker
Greenhorn

Joined: Mar 11, 2008
Posts: 1
Hi ,
Actually the below mentioned Hibernate Query is not working

"select (bwSubMemberDE.registrationDateFrom + 60 YEARS) as REG from BwSubMemberDE as bwSubMemberDE"

Its throwing exception for Bad Sql grammar. And I have one restriction that I can not use native sql query.
[ April 05, 2008: Message edited by: Bear Bibeault ]
Stevi Deter
Ranch Hand

Joined: Mar 22, 2008
Posts: 265

Anandanand,

What exactly are you trying to achieve with your query? Without that explanation, we can't help you figure out the correct syntax.


There will always be people who are ahead of the curve, and people who are behind the curve. But knowledge moves the curve. --Bill James
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

anandanand rairai, please read this.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
GeeCON Prague 2014
 
subject: How to add year in a given date using Hibernate Query