-->
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: How to deal with SQL TIMESTAMP type
PostPosted: Tue Mar 11, 2008 9:30 pm 
Newbie

Joined: Tue Mar 11, 2008 4:23 am
Posts: 8
Hibernate version: 3.2
Mysql 5.0.45

Code:
Mapping documents:
@Type(type="date")
java.util.Date birthday;
@Type(type="time")
java.util.Date birthday;
@Type(type="timestamp")
java.util.Date birthday;
@Type(type="timestamp")
java.sql.TimeStamp birthday;


above of all
these will generate the flowing sql statement like

Code:
birthday date default null;
birthday datetime default null;
birthday datetime default null;
birthday datetime default null;

i use mysql for storge data
then expect to hibernate generate mysql statement like this

Code:
birthday timestamp not null default CURRENT_TIMESTAMP
or update .....



anybody know how to !
please!
thanks
===============================================
请问怎么写映射,才能让他生成MYsql 表
生成这样的字段
上面的写法,怎么都是date 或者 datetime 没有能有映射成为 mysql的timestamp类型 ,还有,如何写映射指定 sql 语句的默认值 也就是 default
部分 ,谢谢!


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.