第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

單元測試通過不了

單元測試通過不了,第一次搞hibernate,也不知道日志里邊測錯(cuò)誤提示在哪。請(qǐng)大神幫忙看看。謝謝


org.hibernate.MappingException: Unknown entity: userHibernate.Students

at org.hibernate.metamodel.internal.MetamodelImpl.entityPersister(MetamodelImpl.java:620)

at org.hibernate.internal.SessionImpl.getEntityPersister(SessionImpl.java:1634)

at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:104)

at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:192)

at org.hibernate.event.internal.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:38)

at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:177)

at org.hibernate.event.internal.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:32)

at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:73)

at org.hibernate.internal.SessionImpl.fireSave(SessionImpl.java:689)

at org.hibernate.internal.SessionImpl.save(SessionImpl.java:681)

at org.hibernate.internal.SessionImpl.save(SessionImpl.java:676)

at userHibernate.StudentsTest.testSaveStudents(StudentsTest.java:49)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)

at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)

at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)

at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)

at org.junit.runners.ParentRunner.run(ParentRunner.java:363)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)

at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)


這是我的cfg.xml文件:

<?xml?version="1.0"?encoding="UTF-8"?>
<!DOCTYPE?hibernate-configuration?PUBLIC?"-//Hibernate/Hibernate?Configuration?DTD?3.0//EN"
?????????????????????????????????????????"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
?<session-factory?name="">
??<property?name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
??<property?name="hibernate.connection.url">jdbc:mysql:///hibernate?useUnicode=true&amp;amp;characterEncoding=UTF-8</property>
??<property?name="hibernate.connection.username">root</property>
??<property?name="hibernate.connection.password">dasfsa</property>
??<property?name="show_sql">true</property>
??<property?name="format_sql">true</property>
??<property?name="dialect">org.hibernate.dialect.MySQLDialect</property>
??<property?name="hbm2ddl.auto">create</property>
??<mapping?resource="Students.hbm.xml"/>
?</session-factory
</hibernate-configuration>


正在回答

2 回答

看些我總結(jié)的 里面有http://www.cnblogs.com/jpwahaha/p/6834102.html

2 回復(fù) 有任何疑惑可以回復(fù)我~
#1

Ziloon_Z 提問者

原因果然是新的hibernate庫的創(chuàng)建服務(wù)注冊(cè)方法不一樣。應(yīng)該是用: ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(config.getProperties()) .configure().build();
2017-05-16 回復(fù) 有任何疑惑可以回復(fù)我~
#2

老季

能對(duì)你有幫助,真的很高心
2017-05-19 回復(fù) 有任何疑惑可以回復(fù)我~
#3

小蝸牛有大理想

感謝題主,把解決方案貼出來,我犯得是第二個(gè)錯(cuò)誤。上網(wǎng)找了兩個(gè)小時(shí)答案,終于在你這找到了,拜謝?。?!
2017-12-28 回復(fù) 有任何疑惑可以回復(fù)我~

非常感謝題主找到答案后,將解決方案貼出來,解決了后來者相同處的困惑。Thanks!

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

單元測試通過不了

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)