wood burning stoves*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 60763
    
  65

anandanand rairai, please read this.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
jQuery in Action, 2nd edition
 
subject: How to add year in a given date using Hibernate Query
 
Similar Threads
Hibernate (decode && null)
native SQL update in Hibernate
Sorting problem with HibernateSqlQuery with Websphere
Criteria API on fields without mapping
What to learn first for Java?