-->
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: Using timestamp in MySQL
PostPosted: Tue Oct 16, 2007 10:49 pm 
Newbie

Joined: Wed Sep 05, 2007 9:26 am
Posts: 16
Hi,

I have this class:

@Entity
@Table(name = "usr")
public class Usr {
private Date last_visit;
// getter/setter omitted
}

the sql generated from hbm2ddl, is:
create table usr (
id bigint not null auto_increment,
last_visit date
)

I'd like it to be Timestamp, possible? how to do that? Thanks.

Angelo


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 17, 2007 3:45 am 
Newbie

Joined: Tue Aug 07, 2007 2:31 am
Posts: 11
try:

Code:
@Temporal(TemporalType.TIMESTAMP)
private Date last_visit;


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.