-->
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.  [ 2 posts ] 
Author Message
 Post subject: Timestamp versioning problem
PostPosted: Wed Apr 14, 2004 1:34 am 
Newbie

Joined: Tue Apr 13, 2004 4:27 am
Posts: 1
I have the persist class Stantion with some fields.
And then I do a simple query like
list = session.find("from Stantion");
it works fine and return me all my objects.

But if I add a timestamp for versioning:

Stantion.java:
Code:
...
Timestamp changeTime;

/**
* @hibernate.timestamp  column="change_time"
*/
    public Timestamp getChangeTime() {
        return changeTime;
    }

    public void setChangeTime(Timestamp changeTime) {
        this.changeTime = changeTime;
    }
...
in Stantion.hbm.xml:
Code:
...
<timestamp name="changeTime" column="change_time"/>
...


this query return me just the first object and null for others

If I call session.find("from Stantion") again I get the first and the second objects in the list and null for others, and so on...

I tried to query it from Hibern8Ide with the same results.
And there is no difference between using java.sql.Timestamp or java.util.Date for timestamp property.

What is wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 7:09 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Turn on SQL logging (check documentation) and look at the generated SQL. I'd say that this is not a Hibernate problem and you will see the correct SQL.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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

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.