void ApplicationVersionRepository::add(const ApplicationVersion &entity, bool *ok)
{
    if (!isValid() || !entity.isValid() || entity.isCreatedByRepo())
        return bSet(ok, false);
    QVariantMap values;
    values.insert("client_type", int(entity.clienType()));
    values.insert("os_type", int(entity.os()));
    values.insert("portable", int(entity.portable()));
    values.insert("processor_architecture_type", int(entity.processorArchitecture()));
    values.insert("download_url", entity.downloadUrl().toString());
    values.insert("version", entity.version().toString());
    bSet(ok, Source->insert("application_versions", values).success());
}
void ApplicationVersionRepository::edit(const ApplicationVersion &entity, bool *ok)
{
    if (!isValid() || !entity.isValid() || entity.isCreatedByRepo())
        return bSet(ok, false);
    QVariantMap values;
    values.insert("download_url", entity.downloadUrl().toString());
    values.insert("version", entity.version().toString());
    QString ws = "client_type = :client_type AND os_type = :os_type AND portable = :portable "
        "AND processor_architecture_type = :processor_architecture_type";
    QVariantMap wvalues;
    wvalues.insert(":client_type", int(entity.clienType()));
    wvalues.insert(":os_type", int(entity.os()));
    wvalues.insert(":portable", int(entity.portable()));
    wvalues.insert(":processor_architecture_type", int(entity.processorArchitecture()));
    bSet(ok, Source->update("application_versions", values, BSqlWhere(ws, wvalues)).success());
}