日期:2014-05-18  浏览次数:20592 次

Hibernate4.3 注解出错!!求大神帮忙!!
我最近刚学习到hibernate  我用注解方式生成表 但每次用@Table( name = " ??")这种方式指定表名的时候就出错  
Exception in thread "main" java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;
at org.hibernate.cfg.annotations.EntityBinder.processComplementaryTableDefinitions(EntityBinder.java:914)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:716)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3598)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3552)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1358)
at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:939)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:188)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:156)
at com.zhj.test.TestT.main(TestT.java:20)
这是错误  我用的是Hibernate 4.3 求各位大神帮忙看看
------解决方案--------------------
javax.persistence.Table.indexes()
意思是javax.persistence包下的Table类没有indexes方法,要么是你jar没导入,要么你jar包冲突了