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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

hibernate配置多對(duì)多映射問題

hibernate配置多對(duì)多映射問題

lzjccc 2017-04-01 20:28:32
?以下是兩個(gè)hibernate映射文件:Activity:<?xml?version="1.0"?encoding="gb2312"?> <!DOCTYPE?hibernate-mapping?PUBLIC??? ????"-//Hibernate/Hibernate?Mapping?DTD?3.0//EN"?? ????"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">? <hibernate-mapping?package="com.ywt.domain">?? ????<class?name="Activity"?table="activity"?lazy="true">?? ????????<!--?id元素定義持久化類的標(biāo)識(shí)屬性?-->?? ????????<id?name="id"> ????????????<!--?指定主鍵生成策略?-->?? ????????????<generator?class="native"?/>?? ????????</id>?? ????????<!--?property元素定義常規(guī)屬性?-->?? ????????<property?name="name"?not-null="true"/>?? ????????<property?name="time"?not-null="true"/>?? ????????<property?name="imageurl"?not-null="true"/>?? ????????<property?name="hostone"?not-null="true"/>?? ????????<property?name="hosttwo"?not-null="true"/>?? ????????<property?name="introduce"?not-null="true"/>?? ????????<property?name="problem"?/>?? ????????<property?name="award"?/>?? ????????<property?name="schedule"?/>?? ????????<property?name="number"?/>?? ????????<property?name="status"?not-null="true"/>?? ????????<set?name="studentSet"?table="activity_student"?inverse="true"> ???????? <key> ???????? <column?name="A_ID"></column> ???????? </key> ???????? <many-to-many?class="Student"?column="S_ID"?></many-to-many> ????????</set>?? ????</class>?? </hibernate-mapping>Student:<?xml?version="1.0"?encoding="gb2312"?> <!DOCTYPE?hibernate-mapping?PUBLIC??? ????"-//Hibernate/Hibernate?Mapping?DTD?3.0//EN"?? ????"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">? <hibernate-mapping?package="com.ywt.domain">?? ????<!--?每個(gè)class元素對(duì)應(yīng)一個(gè)持久化對(duì)象?lazy="true"?代表加載延遲?對(duì)象A對(duì)對(duì)象B引用才會(huì)用到-->?? ????<class?name="Student"?table="student"?lazy="true">?? ????????<!--?id元素定義持久化類的標(biāo)識(shí)屬性?-->?? ????????<id?name="id"> ????????????<!--?指定主鍵生成策略?-->?? ????????????<generator?class="native"?/>?? ????????</id>?? ????????<!--?property元素定義常規(guī)屬性?-->?? ????????<property?name="username"?not-null="true"/>?? ????????<property?name="password"?not-null="true"/>?? ????????<property?name="name"?not-null="true"/>?? ????????<property?name="sex"?not-null="true"/>?? ????????<property?name="major"?not-null="true"/>?? ????????<property?name="academy"?not-null="true"/>?? ????????<property?name="tel"?/>?? ????????<property?name="coin"/>?? ????????<property?name="activities"?/>?? ????????<property?name="honor"?/>? ????????<set?name="activitySet"?table="activity_student"> ???????? <key> ???????? <column?name="S_ID"></column> ???????? </key> ???????? <many-to-many?class="Activity"?column="A_ID"></many-to-many> ????????</set>?? ????</class>?? </hibernate-mapping>所出現(xiàn)的問題是:只要Activity映射文件中一加set集合就報(bào)如下錯(cuò)誤(Student映射文件中加set不報(bào)錯(cuò),已確認(rèn)各屬性書寫沒錯(cuò)誤):嚴(yán)重: Servlet.service() for servlet [mvc] in context with path [/dxshdw] threw exception [Handler processing failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.ywt.util.HibernateUtil] with root causejava.lang.NoClassDefFoundError: Could not initialize class com.ywt.util.HibernateUtil其中HibernateUtil是獲取session工廠的類
查看完整描述

3 回答

?
lzjccc

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

關(guān)聯(lián)關(guān)系維護(hù)出了問題

查看完整回答
1 反對(duì) 回復(fù) 2017-04-02
?
葉為正啊

TA貢獻(xiàn)2條經(jīng)驗(yàn) 獲得超0個(gè)贊

Could not initialize class com.ywt.util.HibernateUtil] 這個(gè)類有問題吧

查看完整回答
反對(duì) 回復(fù) 2017-04-09
?
夢(mèng)影劍魂

TA貢獻(xiàn)66條經(jīng)驗(yàn) 獲得超21個(gè)贊

class com.ywt.util.HibernateUtil這個(gè)工具類就找不見,看是servlet中忘了導(dǎo)入還是其他

查看完整回答
反對(duì) 回復(fù) 2017-04-02
  • lzjccc
    lzjccc
    我找到問題原因了,是關(guān)聯(lián)關(guān)系維護(hù)出了問題。謝謝你的回答!
  • 3 回答
  • 0 關(guān)注
  • 1692 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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