Hibernate5.1.fianl使用JPA注解方式异常:persistence.Table.indexes()[Ljavax/persistence/Index;
Posted 低调的洋仔
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Hibernate5.1.fianl使用JPA注解方式异常:persistence.Table.indexes()[Ljavax/persistence/Index;相关的知识,希望对你有一定的参考价值。
之前开发时我用的是配置文件的方式,实现实体类和数据库中数据的映射关系,后来看到也有注解的方式,也比较方便,就想试试,去Hibernate官网下载了最新版的Hibernate5.1.final版本,直接搭建好环境,进行测试,结果遇到了好几个问题,抛出好几个异常信息。不过逐渐的被解决了。网上对这几个异常处理的解决方案比较少,这里分享一下我是怎么解决的。源码地址:点击打开链接
异常信息
INFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;
at org.hibernate.cfg.annotations.EntityBinder.processComplementaryTableDefinitions
(EntityBinder.java:1087)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:767)
at
org.hibernate.boot.model.source.internal.annotations.AnnotationMetadataSourceProcessorImpl.processEntity
Hierarchies(AnnotationMetadataSourceProcessorImpl.java:245)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess$1.processEntityHierarchies
(MetadataBuildingProcess.java:222)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete
(MetadataBuildingProcess.java:265)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build
(MetadataBuildingProcess.java:83)
at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:418)
at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:87)
at org.hibernate.boot.MetadataSources.buildMetadata(MetadataSources.java:179)
at com.siti.test.HiberTest.<clinit>(HiberTest.java:26)
解决方案
以上是关于Hibernate5.1.fianl使用JPA注解方式异常:persistence.Table.indexes()[Ljavax/persistence/Index;的主要内容,如果未能解决你的问题,请参考以下文章