为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:
【操作系统】:Windows11
【CPU】:
【问题描述】*:Hibernate4.x代码生成出错,无法解析XML文件。
org.hibernate.InvalidMappingException: Could not parse mapping document from string XML String
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXml(Configuration.java:3405)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXmlQueue(Configuration.java:3394)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3382)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1337)
at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:930)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:214)
Caused by: org.hibernate.MappingException: class t_test not found while looking for property: create_date
at org.hibernate.internal.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:232)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:314)
at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:2263)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2228)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2118)
JDBC驱动和hibernate方言驱动
已解决。数据库时间字段类型映射问题。mysql、oracle和达梦有些区别。TIMESTAMP和Date、java.util.Date和java.sql.Timestamp注意区分使用。