熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Java開源技術 >> 正文

JPA和hibernate對刪除操作的不同[2]

2022-06-13   來源: Java開源技術 

    public void setDescription(String description) {
        thisdescription = description;
    }
   
    public Set<Person> getPersons() {
        return persons;
    }

    public void setPersons(Set<Person> persons) {
        thispersons = persons;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        thisid = id;
    }

    @Override
    public int hashCode() {
        int hash = ;
        hash += (id != null ? idhashCode() : );
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning this method wont work in the case the id fields are not set
        if (!(object instanceof Department)) {
            return false;
        }
        Department other = (Department) object;
        if ((thisid == null && otherid != null) || (thisid != null && !thisidequals(otherid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return comhadesleejpaentityDepartment[id= + id + ];
    }
}

[]  []  []  []  []  


From:http://tw.wingwit.com/Article/program/Java/ky/201311/29045.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.