zoukankan      html  css  js  c++  java
  • xdoclet在hibernate中的典型应用1

    对表的声明
    /**
     * @hibernate.class table="author"
     
    */


    一对一
     /**
         * @hibernate.one-to-one cascade="all" constrained="true"
         
    */
        
    public Person getPerson() {
            
    return person;
        }


    多对一、一对多

        
    /**
         * @hibernate.set lazy="true" inverse="true" cascade="all"
         * @hibernate.collection-key column="authorid"
         * @hibernate.collection-one-to-many class="com.cq.Publication"
         
    */
        
    public Set getPublications() {
            
    return publications;
        }

     /**
         * @hibernate.many-to-one column="authorid"
         
    */
        
    public Author getAuthor() {
            
    return author;
        }


    多对多
     /**
         * @hibernate.set lazy="true" table="author_work"
         * @hibernate.collection-key column="author_id"
         * @hibernate.collection-many-to-many column="work_id" class="com.rq.Work"
         
    */
        
    public Set getWorks() {
            
    return works;
        }

     /**
         * @hibernate.set lazy="true" table="author_work"
         * @hibernate.collection-key column="work_id"
         * @hibernate.collection-many-to-many column="author_id" class="com.rq.Author"
         
    */
        
    public Set getAuthors() {
            
    return authors;
        }

  • 相关阅读:
    网页的状态掩码
    分享到JavaScript
    右下角收缩广告
    播放列表的收缩展开
    创建文本节点createTextNode
    创建元素节点createElement
    进栈和出栈
    刚刚上班才回来,今天和你说说hash数组
    关于JS中的定时器!!!
    面向对象(程序员最呆的地方,一切皆是对象)
  • 原文地址:https://www.cnblogs.com/fjchenq/p/776631.html
Copyright © 2011-2022 走看看