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
部分 ,谢谢!