• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate Select - Criteria with a Date

 
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)

DOMAIN:


DAO:


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.

Thanks!


 
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.



 
reply
    Bookmark Topic Watch Topic
  • New Topic