Example #1
0
 @IdeaJdbcTx
 public int deleteSubject(String id) {
   boolean exists = subjectDao.checkExistsProductsOfSubject(id);
   if (exists) {
     throw new IdeaDataException(
         IdeaDataExceptionCode.CANT_DELETE_DUE_ASSO_DATA,
         String.format("Can not delete subject[%s] due having products.", id));
   } else {
     IdeaJdbc.delete(Subject.class, id);
     return 1;
   }
 }