为了账号安全,请及时绑定邮箱和手机立即绑定

无法确定以下列的类型:TIMESTAMP,位于表:

无法确定以下列的类型:TIMESTAMP,位于表:

宝慕林4294392 2022-09-07 21:12:39
Exception in thread "main" org.hibernate.MappingException: Could not determine type for: TIMESTAMP, at table: BATCH_JOB_CONFIG_DTLS, for columns: [org.hibernate.mapping.Column(ADD_USER_DTM)]    at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:486)    at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:453)    at org.hibernate.mapping.Property.isValid(Property.java:226)    at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:624)    at org.hibernate.mapping.RootClass.validate(RootClass.java:267)    at org.hibernate.boot.internal.MetadataImpl.validate(MetadataImpl.java:347)    at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:466)    at com.hms.api.batch.job.config.StartBatchJobConfigApplication.createSession(StartBatchJobConfigApplication.java:71)    at com.hms.api.batch.job.config.StartBatchJobConfigApplication.main(StartBatchJobConfigApplication.java:38)以下是我的代码。在 Main 中调用 createSession() 方法。我有两个实体类。数据库连接在我的休眠状态中提供.cfg.xmlprivate static void createSession() {        StandardServiceRegistry ssr = new StandardServiceRegistryBuilder().configure("hibernate.cfg.xml").build();        Metadata meta = new MetadataSources(ssr).getMetadataBuilder().build();        SessionFactory factory = meta.getSessionFactoryBuilder().build();        Session session = factory.openSession();        Transaction t = session.beginTransaction();        SessionFactory fact = meta.getSessionFactoryBuilder().build();        Session ss = factory.openSession();        Transaction tt = session.beginTransaction();        } 
查看完整描述

1 回答

?
慕田峪4524236

TA贡献1875条经验 获得超5个赞

将所有小写字母“时间戳”而不是大写字母放在 hbm.xml 文件中。像这样:

<property name="addUserDtm" column="ADD_USER_DTM" type="timestamp" />


查看完整回答
反对 回复 2022-09-07
  • 1 回答
  • 0 关注
  • 100 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号