当前位置: 首页>>代码示例>>C++>>正文


C++ FLTableMetaData::isQuery方法代码示例

本文整理汇总了C++中FLTableMetaData::isQuery方法的典型用法代码示例。如果您正苦于以下问题:C++ FLTableMetaData::isQuery方法的具体用法?C++ FLTableMetaData::isQuery怎么用?C++ FLTableMetaData::isQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FLTableMetaData的用法示例。


在下文中一共展示了FLTableMetaData::isQuery方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: contentStaticDir

QString FLManagerModules::contentStaticDir( const QString & n ) {
  QString str_ret( contentFS( staticDirFiles_ + "/" + n ) );

  if ( !str_ret.isEmpty() ) {

    QString sha( FLUtil::sha1( str_ret ) );
    QString * s = 0;
    if ( dictKeyFiles && ( s = ( *dictKeyFiles )[ n ] ) && *s == sha )
      return QString::null;
    else if ( dictKeyFiles && n.endsWith( ".qs" ) )
      dictKeyFiles->replace( n, new QString( sha ) );

    if ( n.endsWith( ".mtd" ) ) {
      FLTableMetaData * mtd;
      QDomDocument doc( n );
      QDomElement docElem;

      if ( FLUtil::domDocumentSetContent( doc, str_ret ) ) {
        FLManager * mgr = db_->manager();
        docElem = doc.documentElement();
        mtd = mgr->metadata( &docElem, true );

        if ( !mtd || mtd->isQuery() )
          return str_ret;

        if ( !mgr->existsTable( mtd->name() ) )
          mgr->createTable( mtd );
        else if ( db_->canRegenTables() )
          db_->regenTable( mtd->name(), mtd );
      }
    }
  }

  return str_ret;
}
开发者ID:AliYousuf,项目名称:abanq-port,代码行数:35,代码来源:FLManagerModules.cpp

示例2: formatAssignValue

QString FLManager::formatAssignValue(FLFieldMetaData *fMD, const QVariant &v, const bool upper)
{
  if (!fMD)
    return "1 = 1";

  FLTableMetaData *mtd = fMD->metadata();
  QString fieldName(fMD->name());

  if (mtd && mtd->isQuery()) {
    QString prefixTable(mtd->name());
    FLSqlQuery *qry = query(mtd->query());

    if (qry) {
      QStringList fL(qry->fieldList());

      for (QStringList::Iterator it = fL.begin(); it != fL.end(); ++it) {
        prefixTable = (*it).section('.', 0, 0);
        if ((*it).section('.', 1, 1) == fieldName)
          break;
      }

      qry->deleteLater();
    }

    fieldName.prepend(prefixTable + ".");
  }

  return formatAssignValue(fieldName, fMD->type(), v, upper);
}
开发者ID:,项目名称:,代码行数:29,代码来源:

示例3: alterTable

bool SqliteDriver::alterTable(const QString &mtd1, const QString &mtd2, const QString &key)
{
#ifndef FL_QUICK_CLIENT
  FLTableMetaData *oldMTD = 0;
  FLTableMetaData *newMTD = 0;
  QDomDocument doc("doc");
  QDomElement docElem;

  if (!FLUtil::domDocumentSetContent(doc, mtd1)) {
#ifdef FL_DEBUG
    qWarning("FLManager::alterTable : " + QApplication::tr("Error al cargar los metadatos."));
#endif
  } else {
    docElem = doc.documentElement();
    oldMTD = db_->manager()->metadata(&docElem, true);
  }

  if (oldMTD && oldMTD->isQuery())
    return true;

  if (!FLUtil::domDocumentSetContent(doc, mtd2)) {
#ifdef FL_DEBUG
    qWarning("FLManager::alterTable : " + QApplication::tr("Error al cargar los metadatos."));
#endif

    return false;
  } else {
    docElem = doc.documentElement();
    newMTD = db_->manager()->metadata(&docElem, true);
  }

  if (!oldMTD)
    oldMTD = newMTD;

  if (oldMTD->name() != newMTD->name()) {
#ifdef FL_DEBUG
    qWarning("FLManager::alterTable : " + QApplication::tr("Los nombres de las tablas nueva y vieja difieren."));
#endif

    if ((oldMTD != newMTD) && oldMTD)
      delete oldMTD;
    if (newMTD)
      delete newMTD;
    return false;
  }

  QString oldPK = oldMTD->primaryKey(), newPK = newMTD->primaryKey();
  if (oldPK != newPK) {
#ifdef FL_DEBUG
    qWarning("FLManager::alterTable : " + QApplication::tr("Los nombres de las claves primarias difieren."));
#endif

    if ((oldMTD != newMTD) && oldMTD)
      delete oldMTD;
    if (newMTD)
      delete newMTD;
    return false;
  }

  if (oldMTD->fieldType(oldPK) != newMTD->fieldType(newPK)) {
#ifdef FL_DEBUG
    qWarning("FLManager::alterTable : " + QApplication::tr("Los tipos de las claves primarias difieren."));
#endif

    if ((oldMTD != newMTD) && oldMTD)
      delete oldMTD;
    if (newMTD)
      delete newMTD;
    return false;
  }

  if (db_->manager()->checkMetaData(oldMTD, newMTD)) {
    if ((oldMTD != newMTD) && oldMTD)
      delete oldMTD;
    if (newMTD)
      delete newMTD;
    return true;
  }

  if (!db_->manager()->existsTable(oldMTD->name())) {
#ifdef FL_DEBUG
    qWarning("FLManager::alterTable : " + QApplication::tr("La tabla %1 antigua de donde importar los registros no existe.").arg(oldMTD->name()));
#endif

    if ((oldMTD != newMTD) && oldMTD)
      delete oldMTD;
    if (newMTD)
      delete newMTD;
    return false;
  }

  FLTableMetaData::FLFieldMetaDataList *fieldList = oldMTD->fieldList();
  FLFieldMetaData *oldField = 0;

  if (!fieldList) {
#ifdef FL_DEBUG
    qWarning("FLManager::alterTable : " + QApplication::tr("Los antiguos metadatos no tienen campos."));
#endif

    if ((oldMTD != newMTD) && oldMTD)
//.........这里部分代码省略.........
开发者ID:gestiweb,项目名称:eneboo,代码行数:101,代码来源:qsqlite.cpp

示例4: doc


//.........这里部分代码省略.........
          buffer->setValue("xml", key);
          dictKey = new QString(key);
          dictKeyMetaData_->replace(n, dictKey);
        }
        newTable = true;
        c.insert();
      } else {
        if (key != key2) {
          QString s;
          if (key2.left(255).find("<!DOCTYPE TMD>", 0, true) == -1)
            AQ_DISKCACHE_FIND(key2, s);
          else
            s = key2;
          bool mustAlter;
          if (key.isEmpty())
            mustAlter = !checkMetaData(s, stream);
          else
            mustAlter = (key != key2);
          if (mustAlter) {
            if (alterTable(s, stream, key2)) {
              QSqlCursor c("flmetadata", true, db_->dbAux());
              c.setForwardOnly(true);
              c.setFilter(QString::fromLatin1("tabla='") + n + QString::fromLatin1("'"));
              c.select();
              c.next();
              buffer = c.primeUpdate();
              if (key.isEmpty()) {
                buffer->setValue("xml", stream);
                dictKey = new QString(stream);
                dictKeyMetaData_->replace(n, dictKey);
              } else {
                buffer->setValue("xml", key);
                dictKey = new QString(key);
                dictKeyMetaData_->replace(n, dictKey);
              }
              c.update();
            }
          }
        }
      }
    }
  } else {
    if (key.isEmpty())
      dictKey = new QString(n);
    else
      dictKey = new QString(key);
  }
#else
  if (key.isEmpty())
    dictKey = new QString(n);
  else
    dictKey = new QString(key);
#endif //FL_QUICK_CLIENT
  if (dictKey) {
    if (cacheMetaData_ && notSysTable) {
      ret = cacheMetaData_->find(*dictKey);
    } else if (cacheMetaDataSys_ && !notSysTable) {
      ret = cacheMetaDataSys_->find(*dictKey);
    }
    if (ret) {
      FLAccessControlLists *acl = aqApp ->acl();
      if (acl)
        acl->process(ret);
      if (quick)
        delete dictKey;
      return ret;
    }
  }

  if (!FLUtil::domDocumentSetContent(doc, stream)) {
#ifdef FL_DEBUG
    qWarning("FLManager : " + QApplication::tr("Error al cargar los metadatos para la tabla %1").arg(n));
#endif
    if (quick)
      delete dictKey;
#ifdef FL_QUICK_CLIENT
    else
      delete dictKey;
#endif
    return 0;
  }

  docElem = doc.documentElement();
  ret = metadata(&docElem, quick);
  if (dictKey &&
      (!notSysTable || (!ret->isQuery() && ret->fieldsNamesUnlock().isEmpty()))) {
    if (cacheMetaData_ && notSysTable) {
      cacheMetaData_->insert(*dictKey, ret);
    } else if (cacheMetaDataSys_ && !notSysTable) {
      cacheMetaDataSys_->insert(*dictKey, ret);
    }
    if (quick)
      delete dictKey;
#ifdef FL_QUICK_CLIENT
    else
      delete dictKey;
#endif
  }
  return ret;
}
开发者ID:,项目名称:,代码行数:101,代码来源:


注:本文中的FLTableMetaData::isQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。