Index: standard/project/web/src/main/java/egovframework/api/rivalWar/compareItem/vo/CompareItemDTO.java =================================================================== diff -u -r669acb8835f67d82924532f373b08eb0e3b55a18 -rf86ce6c5d366bba160a9c9a78e79f3ffe56fe98f --- standard/project/web/src/main/java/egovframework/api/rivalWar/compareItem/vo/CompareItemDTO.java (.../CompareItemDTO.java) (revision 669acb8835f67d82924532f373b08eb0e3b55a18) +++ standard/project/web/src/main/java/egovframework/api/rivalWar/compareItem/vo/CompareItemDTO.java (.../CompareItemDTO.java) (revision f86ce6c5d366bba160a9c9a78e79f3ffe56fe98f) @@ -1,5 +1,8 @@ package egovframework.api.rivalWar.compareItem.vo; +import com.fasterxml.jackson.annotation.JsonBackReference; +import com.fasterxml.jackson.annotation.JsonIgnore; +import egovframework.api.rivalWar.menu.vo.MenuDTO; import egovframework.com.ext.jstree.springHibernate.core.vo.JsTreeHibernateSearchDTO; import org.hibernate.annotations.*; import org.hibernate.annotations.Cache; @@ -52,9 +55,10 @@ this.copyBooleanValue = copyBooleanValue; } - private Number mappingMenuId; + //private Number mappingMenuId; private String compareItemName; + /* @Column(name = "MAPPING_MENU_ID") public Number getMappingMenuId() { return mappingMenuId; @@ -63,7 +67,7 @@ public void setMappingMenuId(Number mappingMenuId) { this.mappingMenuId = mappingMenuId; } - + */ @Column(name = "COMPARE_ITEM_NAME") public String getCompareItemName() { return compareItemName; @@ -80,4 +84,17 @@ } } + private MenuDTO menuDTO; + + //영속성 전이 설정 + @JsonBackReference + @ManyToOne(fetch=FetchType.LAZY) //Lazy Loading 설정 + @JoinColumn(name="MAPPING_MENU_ID") //조인 컬럼 설정 + public MenuDTO getMenuDTO() { + return menuDTO; + } + + public void setMenuDTO(MenuDTO menuDTO) { + this.menuDTO = menuDTO; + } } Index: standard/project/web/src/main/java/egovframework/api/rivalWar/menu/vo/MenuDTO.java =================================================================== diff -u -r2fc0979324cd954b41d5f5c1a6e983742964a8c0 -rf86ce6c5d366bba160a9c9a78e79f3ffe56fe98f --- standard/project/web/src/main/java/egovframework/api/rivalWar/menu/vo/MenuDTO.java (.../MenuDTO.java) (revision 2fc0979324cd954b41d5f5c1a6e983742964a8c0) +++ standard/project/web/src/main/java/egovframework/api/rivalWar/menu/vo/MenuDTO.java (.../MenuDTO.java) (revision f86ce6c5d366bba160a9c9a78e79f3ffe56fe98f) @@ -1,6 +1,7 @@ package egovframework.api.rivalWar.menu.vo; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonManagedReference; import egovframework.api.rivalWar.aggregateResult.vo.AggregateResultDTO; import egovframework.api.rivalWar.compareInfo.vo.CompareInfoDTO; import egovframework.api.rivalWar.compareItem.vo.CompareItemDTO; @@ -12,9 +13,13 @@ import javax.persistence.*; import javax.persistence.CascadeType; import javax.persistence.Entity; +import javax.persistence.ForeignKey; import javax.persistence.Table; import java.io.Serializable; +import java.util.ArrayList; import java.util.Collection; +import java.util.List; +import java.util.Set; @Entity @Table(name = "T_JSTREE_MENU") @@ -124,4 +129,17 @@ this.compareSpecDTO = compareSpecDTO; } + private List compareItemDTOs = new ArrayList(); + + // default fetch type = LAZY + @LazyCollection(LazyCollectionOption.FALSE) + @JsonManagedReference + @OneToMany(mappedBy = "menuDTO", fetch = FetchType.LAZY, cascade = CascadeType.ALL) + public List getCompareItemDTOs() { + return compareItemDTOs; + } + + public void setCompareItemDTOs(List compareItemDTOs) { + this.compareItemDTOs = compareItemDTOs; + } } Index: standard/project/web/src/main/webapp/WEB-INF/jsp/egovframework/api/rivalWar/menu/JsTreeView.jsp =================================================================== diff -u -r23f2cb27735a566b8a443549785c3ca2a886882a -rf86ce6c5d366bba160a9c9a78e79f3ffe56fe98f --- standard/project/web/src/main/webapp/WEB-INF/jsp/egovframework/api/rivalWar/menu/JsTreeView.jsp (.../JsTreeView.jsp) (revision 23f2cb27735a566b8a443549785c3ca2a886882a) +++ standard/project/web/src/main/webapp/WEB-INF/jsp/egovframework/api/rivalWar/menu/JsTreeView.jsp (.../JsTreeView.jsp) (revision f86ce6c5d366bba160a9c9a78e79f3ffe56fe98f) @@ -411,6 +411,10 @@ }] }); }); + + function jsTreeClick(selectedNodeID) { + console.log(selectedNodeID); + }