コード例 #1
0
ファイル: CategoryService.java プロジェクト: sala223/FastBiz
 public void updateCategoryParent(String categoryName, String parentCategoryName) {
   Category find = categoryDAL.findCategoryByName(categoryName);
   if (find == null) {
     throw CategoryException.CategoryNonExistException(categoryName);
   }
   Category parent = categoryDAL.findCategoryByName(parentCategoryName);
   if (parent == null) {
     throw CategoryException.parentCategoryNotExistException(parentCategoryName);
   }
   find.setParent(parent);
   categoryDAL.merge(find);
 }
コード例 #2
0
ファイル: CategoryService.java プロジェクト: sala223/FastBiz
 public void updateCategoryParent(long categoryId, long parentCategoryId) {
   Category find = categoryDAL.find(Category.class, categoryId);
   if (find == null) {
     throw CategoryException.CategoryNonExistException(categoryId);
   }
   Category parent = categoryDAL.find(Category.class, categoryId);
   if (parent == null) {
     throw CategoryException.parentCategoryNotExistException(parentCategoryId);
   }
   find.setParent(parent);
   categoryDAL.merge(find);
 }