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

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

用hibernate,明明配置文件路勁正確,可是一直報錯!求大神解救

用hibernate,明明配置文件路勁正確,可是一直報錯!求大神解救

慕桂英8054818 2016-10-08 13:15:30
這是我的文件結(jié)構(gòu)Grade.hbm.xml????????????<hibernate-mapping> <class name="com.imooc.entity.Grade" table="grade"> <id name="gid" column="gid" type="java.lang.Integer"> <generator class="increment"></generator> </id> <property name="gname" type="java.lang.String"> <column name="gname" length="20" not-null="true"></column> </property> <property name="gdesc"> <column name="gdesc"></column> </property> <!-- 配置一對多關(guān)聯(lián)關(guān)系 --> <set name="students" table="student"> <key column="gid"></key> <one-to-many class="com.wzl.entity.Student"/> </set> </class></hibernate-mapping>hibernate.cfg.xml<hibernate-configuration>? ? <session-factory>? ? ? ? <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>? ? ? ? <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>? ? ? ? <property name="hibernate.connection.username">root</property>? ? ? ? <property name="hibernate.connection.password">123</property>? ? ? ? <property name="hibernate.connection.url">? ? ? ? <![CDATA[? ? ? ? jdbc:mysql://localhost:3306/wzl?useUnicode=true&characterEncoding=utf8? ? ? ? ]]>? ? ? ? </property>? ? ? ? <property name="show_sql">true</property>? ? ? ? <property name="hbm2ddl.auto">update</property>? ??? ? <!-- 指定映射文件的路徑 -->? ? <mapping resource="com.wzl.entity.Grade.hbm.xml"/>? ? <mapping resource="com.wzl.entity.Student.hbm.xml"/>? ? </session-factory></hibernate-configuration>報錯:十月 08, 2016 12:51:42 下午 org.hibernate.annotations.common.Version <clinit>INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}十月 08, 2016 12:51:42 下午 org.hibernate.Version logVersionINFO: HHH000412: Hibernate Core {4.2.4.Final}十月 08, 2016 12:51:42 下午 org.hibernate.cfg.Environment <clinit>INFO: HHH000206: hibernate.properties not found十月 08, 2016 12:51:42 下午 org.hibernate.cfg.Environment buildBytecodeProviderINFO: HHH000021: Bytecode provider name : javassist十月 08, 2016 12:51:42 下午 org.hibernate.cfg.Configuration configureINFO: HHH000043: Configuring from resource: /hibernate.cfg.xml十月 08, 2016 12:51:42 下午 org.hibernate.cfg.Configuration getConfigurationInputStreamINFO: HHH000040: Configuration resource: /hibernate.cfg.xml十月 08, 2016 12:51:42 下午 org.hibernate.cfg.Configuration addResourceINFO: HHH000221: Reading mappings from resource: com.wzl.entity.Grade.hbm.xmlException in thread "main" org.hibernate.MappingNotFoundException: resource: com.wzl.entity.Grade.hbm.xml not found at org.hibernate.cfg.Configuration.addResource(Configuration.java:738) at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2188) at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2160) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2140) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2093) at org.hibernate.cfg.Configuration.configure(Configuration.java:2008) at org.hibernate.cfg.Configuration.configure(Configuration.java:1987) at com.wzl.test.Test2.add(Test2.java:34) at com.wzl.test.Test2.main(Test2.java:20)
查看完整描述

3 回答

已采納
?
happyJared

TA貢獻(xiàn)7條經(jīng)驗 獲得超1個贊

兩個錯誤 一個是class的name屬性為:com.wzl.entity.grade,顯然不是什么com.imooc.*。第二個就是mapping那里映射請用反斜杠。
查看完整回答
1 反對 回復(fù) 2016-10-08
?
yanrun

TA貢獻(xiàn)317條經(jīng)驗 獲得超240個贊

應(yīng)該用/分割不是.<mapping resource="com/wzl/entity/Grade.hbm.xml"/>

查看完整回答
反對 回復(fù) 2016-10-08
?
RuthlessPotato丶

TA貢獻(xiàn)19條經(jīng)驗 獲得超9個贊

在hibernate的hibernate.cfg.xml 中的<mapping resource=" ? ?"/> 找不到相應(yīng)的路徑下的xml

你實(shí)體類上有了注解,就不要配置xml映射

查看完整回答
反對 回復(fù) 2016-10-08
  • 3 回答
  • 0 關(guān)注
  • 8015 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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