• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Hibernate Select - Criteria with a Date

Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate appears to be using a 'fasttime' value?? for my date in its WHERE clause and doesn't return rows that it should from the database:

Here's a 50K foot view of my Doman and DAO objects along with the SQL output.
I'm using annotations for hibernate and have set the temporal type for my date objects to DATE (I've tried all three)



My variables output shows that the start and end date 'criterion' are pointing to the correct property name, but when it comes to the actual value, cdate is null and fasttTme is 1304139600000.

Unfortunately, my log4j.xml isn't responding to TRACE, so I am not able to see the actual parameters I'm hoping I'm still on the right track.

Here's what Hibernate has for a query:

when I use the values from fastTime values, the rows do not come back.
when I use the 'yyyy-MM-dd' equivalent of the fast time values, the query does work.

This is how I was able to confirm the equivalent from the fastTime:

Hoping for a little nudge in the right direction.


Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a thought. Can we not annotate and override the getter methods of dates to return values of desired type?
Chris Montgomery
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many apologies folks. False alarm. the dates weren't even the issue. it was a separate criteria that was the culprit.

For some reason I keep having to relearn the lesson of 'elimination'.
Start removing various factors to weed out the cause.

After some pecan pie, you might want to cleanse your palatte with this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic