Index: standard/project/web/src/main/java/egovframework/api/rivalWar/directChat/controller/AdminDirectChatController.java =================================================================== diff -u -r8e1302ac5032c4d5fc99f741925d52cfcdace36e -r6df0f3daa6240912227cc4bd250e822fd9529778 --- standard/project/web/src/main/java/egovframework/api/rivalWar/directChat/controller/AdminDirectChatController.java (.../AdminDirectChatController.java) (revision 8e1302ac5032c4d5fc99f741925d52cfcdace36e) +++ standard/project/web/src/main/java/egovframework/api/rivalWar/directChat/controller/AdminDirectChatController.java (.../AdminDirectChatController.java) (revision 6df0f3daa6240912227cc4bd250e822fd9529778) @@ -61,20 +61,11 @@ searchMenuDTO.setC_id(menuCId); MenuDTO menuDTO = menuService.getNode(searchMenuDTO); + jsTreeHibernateDTO.setMenuDTO(menuDTO); - DirectChatDTO addedNode = directChatService.addNode(jsTreeHibernateDTO); - - menuDTO.getDirectChatDTOs().add(addedNode); - - menuService.alterNode(menuDTO); - ModelAndView modelAndView = new ModelAndView("jsonView"); - modelAndView.addObject("result", addedNode); + modelAndView.addObject("result", directChatService.addNode(jsTreeHibernateDTO)); - //메뉴 하나 가져온다 ( 향후 이부분은 리퀘스트로 대치 ) - - - return modelAndView; } Index: standard/project/web/src/main/java/egovframework/api/rivalWar/directChat/vo/DirectChatDTO.java =================================================================== diff -u -r458facbd00d299a2ec09b3d7d38a55baf0e629ce -r6df0f3daa6240912227cc4bd250e822fd9529778 --- standard/project/web/src/main/java/egovframework/api/rivalWar/directChat/vo/DirectChatDTO.java (.../DirectChatDTO.java) (revision 458facbd00d299a2ec09b3d7d38a55baf0e629ce) +++ standard/project/web/src/main/java/egovframework/api/rivalWar/directChat/vo/DirectChatDTO.java (.../DirectChatDTO.java) (revision 6df0f3daa6240912227cc4bd250e822fd9529778) @@ -1,5 +1,7 @@ package egovframework.api.rivalWar.directChat.vo; +import com.fasterxml.jackson.annotation.JsonBackReference; +import egovframework.api.rivalWar.menu.vo.MenuDTO; import egovframework.com.ext.jstree.springHibernate.core.vo.JsTreeHibernateSearchDTO; import org.hibernate.annotations.Cache; import org.hibernate.annotations.*; @@ -165,4 +167,21 @@ } } + + private MenuDTO menuDTO; + + @JsonBackReference + @ManyToOne + @JoinTable( + name = "T_M_MENU_DIRECTCHAT", + joinColumns = @JoinColumn(name = "DIRECTCHAT_CID"), + inverseJoinColumns = @JoinColumn(name = "MENU_CID") + ) + public MenuDTO getMenuDTO() { + return menuDTO; + } + + public void setMenuDTO(MenuDTO menuDTO) { + this.menuDTO = menuDTO; + } }