-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate calendar
PostPosted: Thu Feb 26, 2009 5:27 am 
Newbie

Joined: Wed Feb 25, 2009 6:56 pm
Posts: 1
Location: Ferrol
I have a hbm.xml that have a calendar:

<property name="fec_modificacion" type="calendar" />


and i'd like get all the objects in the year 2008:

i try this:
Query hql = new HqlQuery();
query string =
(from entidad e
where e.fecha > :fechaINI
and e.fecha < :fechaFIN)
fechaINI like 01/01/2008
fechaFIN like 31/12/2008
queryHQL.setCalendar("fechaINI", calendar);
queryHQL.setCalendar("fechaFIN", calendar);
hql.setQuery (query string);


But i think that it's not good solution.

can i compare the year in a property calendar in hql?

any idea?
other solution?

thanks

_________________
Rodrigo


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.