code: public T save() {
          beforeAll();
          if (isNew()) {
              beforeInsert();
              crudService.insert(entity);
              afterInsert();
          } else {
              beforeUpdate();
              entity = crudService.update(entity);
              afterUpdate();
          }
          afterAll();
          return entity;
      }
docs: actions