reset password
Author Message
Urvashi
Posts: 34
Posted 01:03 May 07, 2009 |

i am trying to retrieve data for archive on the blog layout....

My query has 'select to_char(date,'month'),to_char(date,'yyyy'), .....' in it. how can i access these columns from my jsp or infact how is this going to be stored in a list?

abhishek_sharma
Posts: 79
Posted 01:29 May 07, 2009 |

Even same is the case with me but, how to execute in HQL.

cysun
Posts: 2935
Posted 07:49 May 07, 2009 |
Urvashi wrote:

i am trying to retrieve data for archive on the blog layout....

My query has 'select to_char(date,'month'),to_char(date,'yyyy'), .....' in it. how can i access these columns from my jsp or infact how is this going to be stored in a list?

How do you come up with "to_char(date,'month') and to_char(date,'yyyy')"? They are not HQL functions, and we are not using Oracle.

Anyways, you need to write an HQL query (and HQL deal with objects, not columns). The query should return Date or Calendar objects, or BlogEntry objects from which you can get the Date or Calendar objects.

Last edited by cysun at 07:50 May 07, 2009.
cysun
Posts: 2935
Posted 07:53 May 07, 2009 |
abhishek_sharma wrote:

Even same is the case with me but, how to execute in HQL.

Learn HQL, think very hard, trial and error .... Do what needs to be done to figure it out. This is a homework.

abhishek_sharma
Posts: 79
Posted 08:50 May 07, 2009 |

Thank You Dr. Sun

Urvashi
Posts: 34
Posted 09:59 May 07, 2009 |
What will be the return type of month(date) in HQL

 

Urvashi
Posts: 34
Posted 10:02 May 07, 2009 |
Urvashi wrote:
What will be the return type of month(date) in HQL


and also for count(*), i read that it is long , but i just want to confirm