コード例 #1
0
ファイル: AreaService.java プロジェクト: Runko/runko-server
 /**
  * Goes through the list of areas that an element has a database connection to, and removes any
  * connections from the areas to the element -- but not from the element to the areas.
  *
  * @param element on which connections will be removed
  */
 public void deleteElementFromAreas(Element element) {
   for (Area area : element.getAreas()) {
     area.deleteElement(element);
     areaRepository.save(area);
   }
 }
コード例 #2
0
ファイル: AreaService.java プロジェクト: Runko/runko-server
 /**
  * Goes through the list of areas that an element has a database connection to, and makes sure the
  * areas also have a connection to the element.
  *
  * @param element the element that connections will be checked on
  */
 public void saveContentToAreas(Element element) {
   for (Area area : element.getAreas()) {
     area.addElement(element);
     areaRepository.save(area);
   }
 }