I use Hibernate Entity Manager with JBoss 4.2.2 and Seam 2.0 and I have marked my
java.util.Date mapped fields with
@Temporal(TIMESTAMP) but Hibernate generates
datetime' MySQL columns instead of '
timestamp'.
This is a big problem since this is going to be an international application and I want to store dates/times in db as number of millis since epoch (1970-01-01 00:00:00 UTC) and display them back to users in their own TimeZones rather than storing the year, month, day, hour, minute and seconds as a
datetime.
For more info please refer to MySQL documentation.
http://dev.mysql.com/doc/refman/5.0/en/ ... ments.html
Hibernate version:
Hibernate 3.2 that comes with JBoss 4.2.2.GA
Mapping documents:
N/A since I used JPA/EJB3 annotations.
I use org.hibernate.dialect.MySQL5InnoDBDialect
Code between sessionFactory.openSession() and session.close():
N/A
Full stack trace of any exception that occurs:
N/A
Name and version of the database you are using:
MySQL 5.0.45
The generated SQL (show_sql=true):
Code:
CREATE TABLE `order_issue` (
`id` bigint(20) NOT NULL auto_increment,
`version` int(11) default NULL,
`uuid_least_sig_bits` bigint(20) default NULL,
`uuid_most_sig_bits` bigint(20) default NULL,
`message` mediumtext NOT NULL,
`status` tinyint(4) NOT NULL,
`visibility` tinyint(4) NOT NULL,
`reminder` bit(1) NOT NULL,
`create_time` datetime NOT NULL,
`modified_time` datetime NOT NULL,
`reporter_id` bigint(20) NOT NULL,
`order_id` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK751060A8FBC778ED` (`reporter_id`),
KEY `FK751060A883DB4C31` (`order_id`),
CONSTRAINT `FK751060A883DB4C31` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`),
CONSTRAINT `FK751060A8FBC778ED` FOREIGN KEY (`reporter_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
Debug level Hibernate log excerpt:
N/A
Problems with Session and transaction handling?
N/A