myeclipse中新建了一个hibernate项目,运行时出现如下错误,求解!!!
Exceptioninthread"main"java.lang.ExceptionInInitializerErroratview.HibernateTest.main...
Exception in thread "main" java.lang.ExceptionInInitializerError
at view.HibernateTest.main(HibernateTest.java:29)
Caused by: org.hibernate.MappingException: could not instantiate id generator [entity-name=zte.Userinfo]
at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:132)
at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:175)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:230)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
at util.HibernateUtil.<clinit>(HibernateUtil.java:11)
... 1 more
Caused by: org.hibernate.MappingException: Dialect does not support sequences
at org.hibernate.dialect.Dialect.getSequenceNextValString(Dialect.java:619)
at org.hibernate.id.SequenceGenerator.configure(SequenceGenerator.java:88)
at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:127)
... 5 more 展开
at view.HibernateTest.main(HibernateTest.java:29)
Caused by: org.hibernate.MappingException: could not instantiate id generator [entity-name=zte.Userinfo]
at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:132)
at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:175)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:230)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
at util.HibernateUtil.<clinit>(HibernateUtil.java:11)
... 1 more
Caused by: org.hibernate.MappingException: Dialect does not support sequences
at org.hibernate.dialect.Dialect.getSequenceNextValString(Dialect.java:619)
at org.hibernate.id.SequenceGenerator.configure(SequenceGenerator.java:88)
at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:127)
... 5 more 展开
展开全部
主见生成策略不正确,还有一个错误时,在映射文件中Dialect 是是数据库的发言,不支持该主见生成策略,查看在hibernate配置文件当汇总的
<id name="carid" type="java.lang.String">
<column name="CARID" length="200" />
<generator class="native" />
</id>
<generator class="native" />是否配置正确呢?看看你连接的什么数据库啦
<id name="carid" type="java.lang.String">
<column name="CARID" length="200" />
<generator class="native" />
</id>
<generator class="native" />是否配置正确呢?看看你连接的什么数据库啦
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询