Java+Hibernation+MySQL的@JsonIgnore註解

當表間有One2Many或Many2One時,會發生無限循環的場景,如何破?this

只要在Set方法前增長如下註解便可:spa

 @JsonIgnore  
    public Set xxxs() {
        return this.xxxYyyy;
    }
相關文章
相關標籤/搜索