国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
Hibernate樹(shù)型結(jié)構(gòu)的算法,附源碼!
/**
* @hibernate.class
*  table="tree"
*/

public class Component {
       
        private long id;

        private String name;
       
        private Component parent;
       
        private Set children=new HashSet();
       
        private Component(){}
       
        public Component(String name){
                this.name=name;
        }
       
        /**
        * @hibernate.id
        *  generator-class = "native"
        */
 
        public getId(){
                return Id;
        }
       
        private setId(long id){
                this.id=id;
        }
       
        /**
        * @hibernate.property
        *  length="64"
        *  not-null="true"
        */

        public String getName(){
                return name;
        }
       
        public void setName(String name){
                this.name=name;
        }
       
        /**
        * 獲得父節(jié)點(diǎn)
        * @hibernate.many-to-one
        *  column="parentId"
        */

        public Component getParent(){
                return parent;
        }
       
        public void setParent(Component parent){
                this.parent=parent;
        }
       
        /**
        * 獲得子節(jié)點(diǎn)
        * @hibernate.set
        *  lazy = "true"
        *  table = "tree"
        * @hibernate.collection-key
        *  column = "parentId"
        * @hibernate.collection-one-to-many
        *  class = "Component"
        */

        public Set getChildren(){
                return children;
        }
       
        private void setChildren(Set children){
                this.children=children;
        }
       
        public void addChild(Component child){
                children.add(child);
        }
       
        public void removeChild(Component child){
                childrent.remove(child);
        }
       
        public void clearChildren(){
                children=new HashSet();
        }
}
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
Hibernate 組合映射使用
使用hibernate實(shí)現(xiàn)樹(shù)形結(jié)構(gòu)無(wú)限級(jí)分類
Eclipse快速上手Hibernate--5.組件映射
Hibernate Annotations 實(shí)戰(zhàn)
HIBERNATE一對(duì)多配置實(shí)例
slave4j ,看了介紹,感覺(jué)不錯(cuò)。
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服