hibernate reverse engineering, customized type mapping, MappingException

在myeclipse reverse engineering生成 hbm.xml的时候, mysql的timestamp类型会被映射到java.sql.Timestamp, 需要自定义呢, 要改 customized type mapping, 添加自定义的mapping, 如果输入timestamp --> java.util.Date 会产生以下错误:
org.hibernate.MappingException: jdbc-type: timestamp is not a known JDBC Type nor a valid number
 
结论是JDBC Type要大写, 比如 JDBC Type: TIMESTAMP, Hibernate Type: java.util.Date

相关推荐