读书人

hibernate reverse engineering, cust

发布时间: 2012-11-19 10:18:51 作者: rapoo

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

读书人网 >软件架构设计

热点推荐