-->
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: MySQL date functions - strange behavior?
PostPosted: Mon May 09, 2005 3:21 pm 
Newbie

Joined: Wed Apr 06, 2005 2:54 pm
Posts: 1
Location: Austin, TX
I am new to both the Java community and Hibernate. I am attempting to use date functions and then aggregate them. Here is what I am doing:

Code:
Iterator i = session.createQuery("select s.person, sum(s.viewed), sum(time_to_sec(timeEnd) - time_to_sec(timeStart))" +
         "from SessionTrackerN s " +
         "where s.districtId = 101902 " +
         "group by s.person"
    )
    .setFirstResult(0)
    .setMaxResults(20)
    .list()
    .iterator();


The "strange" thing is object returned contains only the first two columns of the result set. The debugger shows the third column is not there. No error is provided.

My meager dealing with Hibernate so far lead me to believe that a silent failure is either an unintended behaviour, or I have missed something.

I appreciate any light someone can shed on this!

My versions are
MySQL 4.0.23
Hibernate versino 2.1.8

_________________
Boyd E. Hemphill


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.