Hi,
I'm trying to map 'logoutTime' java.sql.Timestamp property to SQL TIMESTAMP, but SchemaExport keeps generating DATETIME instead. How can I generate TIMESTAMP?
thanks,
-nikita
Hibernate version:
3.1
Mapping documents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping
>
<class
name="net.eviltwinstudios.common.beans.UserSession"
table="user_sessions"
>
<id
name="id"
column="id"
type="java.lang.String"
>
<generator class="assigned">
</generator>
</id>
<version
name="hibernateVersion"
column="hibernateVersion"
type="java.lang.Integer"
unsaved-value="null"
/>
<property
name="loginTime"
type="java.sql.Timestamp"
update="true"
insert="true"
column="loginTime"
/>
<property
name="logoutTime"
type="timestamp"
update="true"
insert="true"
column="logoutTime"
/>
</class>
</hibernate-mapping>
POJO Source :
Code:
/**
* @hibernate.property type="timestamp"
*/
public Timestamp getLogoutTime() {
return logoutTime;
}
/**
* @hibernate.property
*/
public Timestamp getLoginTime() {
return loginTime;
}
Full stack trace of any exception that occurs:
Name and version of the database you are using:
Mysql 5.0 InnoDB
The generated SQL (show_sql=true):
DROP TABLE IF EXISTS `evilsite`.`user_sessions`;
CREATE TABLE `evilsite`.`user_sessions` (
`id` varchar(255) NOT NULL,
`hibernateVersion` int(11) NOT NULL,
`loginTime` datetime default NULL,
`logoutTime` datetime default NULL,
PRIMARY KEY (`id`),
) ENGINE=InnoDB DEFAULT CHARSET=latin1;