@Override
 public void delete(T entity) {
   if (entity != null) {
     if (entity instanceof BaseData) {
       ((BaseData) entity).setRecordStatus(RecordStatus.DELETED);
       super.save(entity);
     }
   }
 }
  @Override
  public T save(T entity) {
    if (entity == null) return null;

    if (entity instanceof BaseData) {
      if (StringUtils.isBlank(((BaseData) entity).getId())) {
        ((BaseData) entity).setId(null);
      }
    }

    return super.save(entity);
  }