gah, next time please dont answer...

-igor

On Dec 3, 2007 5:00 AM, Roy van Rijn <[EMAIL PROTECTED]> wrote:
> Not really a Wicket question... but as long as we answer :)
>
> You can just use Date objects in Hibernate:
>
> Criteria criteria = session.createCriteria(Sale.class);
> if (startDate != null) {
>         criteria.add(Expression.ge("date",startDate);
> }
> List results = criteria.list();
>
> And in HQL you can do:
>
>  Map parameters = new HashMap();
>  StringBuffer queryBuf = new StringBuffer("from Sale s ");
>  boolean firstClause = true;
>
>  if (startDate != null) {
>           queryBuf.append(firstClause ? " where " : " and ");
>           queryBuf.append("s.date >= :startDate");
>           parameters.put("startDate",startDate);
>           firstClause = false;
>  }
>
> (examples from: http://www.javalobby.org/articles/hibernatequery102/)
>
> Roy
>
>
> On 12/3/07, wicketshafi <[EMAIL PROTECTED]> wrote:
> >
> >
> > I am using wicket ,hibernate ...
> >
> > Use Case:  getting all the records which are created within 30 days....
> >
> > DATE_SUB(CURDATE(),INTERVAL 30 DAY) is giving error in hibernate....
> > can any body help me  to solve this issue ....
> >
> > if you know hibernate date functions  regarding this issue..
> > could you let me know once...
> >
> > regards
> > Shafi
> >
> >
> >
> >
> > --
> > View this message in context: 
> > http://www.nabble.com/Pagination-Probelm-with-date_Sub%28%29%3A-MYSQL-%2BHIberante-tf4936098.html#a14128684
> > Sent from the Wicket - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to