public static void createDatabasePrivilegeTemplateEntry(
      DatabasePrivilegeSet dto, DatabasePrivilegeTemplateEntry entity) {
    if (dto == null || entity == null) {
      return;
    }

    entity.setAlterPriv(dto.getAlterPriv());
    entity.setCreatePriv(dto.getCreatePriv());
    entity.setDeletePriv(dto.getDeletePriv());
    entity.setDropPriv(dto.getDropPriv());
    entity.setIndexPriv(dto.getIndexPriv());
    entity.setInsertPriv(dto.getInsertPriv());
    entity.setSelectPriv(dto.getSelectPriv());
    entity.setUpdatePriv(dto.getUpdatePriv());

    if (dto instanceof MySQLPrivilegeSet) {
      MySQLPrivilegeSet mysqlDTO = (MySQLPrivilegeSet) dto;
      entity.setAlterRoutinePriv(mysqlDTO.getAlterRoutinePriv());
      entity.setCreateRoutinePriv(mysqlDTO.getCreateRoutinePriv());
      entity.setCreateTmpTablePriv(mysqlDTO.getCreateTmpTablePriv());
      entity.setCreateViewPriv(mysqlDTO.getCreateViewPriv());
      entity.setEventPriv(mysqlDTO.getEventPriv());
      entity.setExecutePriv(mysqlDTO.getExecutePriv());
      entity.setGrantPriv(mysqlDTO.getGrantPriv());
      entity.setLockTablesPriv(mysqlDTO.getLockTablesPriv());
      entity.setReferencesPriv(mysqlDTO.getReferencesPriv());
      entity.setAlterRoutinePriv(mysqlDTO.getAlterRoutinePriv());
      entity.setShowViewPriv(mysqlDTO.getShowViewPriv());
      entity.setTriggerPriv(mysqlDTO.getTriggerPriv());
    }
  }
  public static void createDatabasePrivilegeSetInfo(
      DatabasePrivilegeSetInfo info, DatabasePrivilegeSet entity) {
    if (info == null || entity == null) {
      return;
    }
    info.setAlterPriv(entity.getAlterPriv());
    info.setCreatePriv(entity.getCreatePriv());
    info.setDeletePriv(entity.getDeletePriv());
    info.setDropPriv(entity.getDropPriv());
    info.setIndexPriv(entity.getIndexPriv());
    info.setInsertPriv(entity.getInsertPriv());
    info.setSelectPriv(entity.getSelectPriv());
    info.setUpdatePriv(entity.getUpdatePriv());

    if (info instanceof MySQLPrivilegeSetInfo && entity instanceof MySQLPrivilegeSet) {
      MySQLPrivilegeSetInfo mysqlInfo = (MySQLPrivilegeSetInfo) info;
      MySQLPrivilegeSet mysqlEntity = (MySQLPrivilegeSet) entity;

      mysqlInfo.setCreateRoutinePriv(mysqlEntity.getCreateRoutinePriv());
      mysqlInfo.setCreateTmpTablePriv(mysqlEntity.getCreateTmpTablePriv());
      mysqlInfo.setCreateViewPriv(mysqlEntity.getCreateViewPriv());
      mysqlInfo.setEventPriv(mysqlEntity.getEventPriv());
      mysqlInfo.setExecutePriv(mysqlEntity.getExecutePriv());
      mysqlInfo.setGrantPriv(mysqlEntity.getGrantPriv());
      mysqlInfo.setLockTablesPriv(mysqlEntity.getLockTablesPriv());
      mysqlInfo.setReferencesPriv(mysqlEntity.getReferencesPriv());
      mysqlInfo.setAlterRoutinePriv(mysqlEntity.getAlterRoutinePriv());
      mysqlInfo.setShowViewPriv(mysqlEntity.getShowViewPriv());
      mysqlInfo.setTriggerPriv(mysqlEntity.getTriggerPriv());
    }
  }