• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TSqlORMapper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中TSqlORMapper的典型用法代码示例。如果您正苦于以下问题:C++ TSqlORMapper类的具体用法?C++ TSqlORMapper怎么用?C++ TSqlORMapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: gc

int TSessionSqlObjectStore::gc(const QDateTime &expire)
{
    TSqlORMapper<TSessionObject> mapper;
    TCriteria cri(TSessionObject::UpdatedAt, TSql::LessThan, expire);
    int cnt = mapper.removeAll(cri);
    return cnt;
}
开发者ID:AbhimanyuAryan,项目名称:treefrog-framework,代码行数:7,代码来源:tsessionsqlobjectstore.cpp


示例2: store

bool TSessionSqlObjectStore::store(TSession &session)
{
    TSqlORMapper<TSessionObject> mapper;
    TCriteria cri(TSessionObject::Id, TSql::Equal, session.id());
    TSessionObject so = mapper.findFirst(cri);

#ifndef TF_NO_DEBUG
    {
        QByteArray badummy;
        QDataStream dsdmy(&badummy, QIODevice::ReadWrite);
        dsdmy << *static_cast<const QVariantMap *>(&session);

        TSession dummy;
        dsdmy.device()->seek(0);
        dsdmy >> *static_cast<QVariantMap *>(&dummy);
        if (dsdmy.status() != QDataStream::Ok) {
            tSystemError("Failed to store a session into the cookie store. Must set objects that can be serialized.");
        }
    }
#endif

    QDataStream ds(&so.data, QIODevice::WriteOnly);
    ds << *static_cast<const QVariantMap *>(&session);

    if (ds.status() != QDataStream::Ok) {
        tSystemError("Failed to store session. Must set objects that can be serialized.");
        return false;
    }

    if (so.isNull()) {
        so.id = session.id();
        return so.create();
    }
    return so.update();
}
开发者ID:skipbit,项目名称:treefrog-framework,代码行数:35,代码来源:tsessionsqlobjectstore.cpp


示例3: remove

bool TSessionSqlObjectStore::remove(const QDateTime &garbageExpiration)
{
    TSqlORMapper<TSessionObject> mapper;
    TCriteria cri(TSessionObject::UpdatedAt, TSql::LessThan, garbageExpiration);
    int cnt = mapper.removeAll(cri);
    return (cnt >= 0);
}
开发者ID:Keloran,项目名称:treefrog-framework,代码行数:7,代码来源:tsessionsqlobjectstore.cpp


示例4: get

RefPackingDef RefPackingDef::get(const QString &createdBy, const QString &updatedBy)
{
    TCriteria cri;
    cri.add(RefPackingDefObject::CreatedBy, createdBy);
    cri.add(RefPackingDefObject::UpdatedBy, updatedBy);
    TSqlORMapper<RefPackingDefObject> mapper;
    return RefPackingDef(mapper.findFirst(cri));
}
开发者ID:hks2002,项目名称:AM,代码行数:8,代码来源:refpackingdef.cpp


示例5: get

Vehicles Vehicles::get(int id, int lockRevision)
{
    TSqlORMapper<VehiclesObject> mapper;
    TCriteria cri;
    cri.add(VehiclesObject::Id, id);
    cri.add(VehiclesObject::LockRevision, lockRevision);
    return Vehicles(mapper.findFirst(cri));
}
开发者ID:czjin,项目名称:bbpark,代码行数:8,代码来源:vehicles.cpp


示例6: get

ParkAttendants ParkAttendants::get(int id, int lockRevision)
{
    TSqlORMapper<ParkAttendantsObject> mapper;
    TCriteria cri;
    cri.add(ParkAttendantsObject::Id, id);
    cri.add(ParkAttendantsObject::LockRevision, lockRevision);
    return ParkAttendants(mapper.findFirst(cri));
}
开发者ID:czjin,项目名称:bbpark,代码行数:8,代码来源:parkattendants.cpp


示例7: get

ChatLog ChatLog::get(int id, int lockRevision)
{
    TSqlORMapper<ChatLogObject> mapper;
    TCriteria cri;
    cri.add(ChatLogObject::Id, id);
    cri.add(ChatLogObject::LockRevision, lockRevision);
    return ChatLog(mapper.findFirst(cri));
}
开发者ID:treefrogframework,项目名称:chatapp,代码行数:8,代码来源:chatlog.cpp


示例8: get

UserVehicle UserVehicle::get(int id, int lockRevision)
{
    TSqlORMapper<UserVehicleObject> mapper;
    TCriteria cri;
    cri.add(UserVehicleObject::Id, id);
    cri.add(UserVehicleObject::LockRevision, lockRevision);
    return UserVehicle(mapper.findFirst(cri));
}
开发者ID:czjin,项目名称:bbpark,代码行数:8,代码来源:uservehicle.cpp


示例9: getAllJson

QJsonArray AccountsRecharge::getAllJson()
{
    QJsonArray array;
    TSqlORMapper<AccountsRechargeObject> mapper;

    if (mapper.find() > 0) {
        for (TSqlORMapperIterator<AccountsRechargeObject> i(mapper); i.hasNext(); ) {
            array.append(QJsonValue(QJsonObject::fromVariantMap(AccountsRecharge(i.next()).toVariantMap())));
        }
    }
    return array;
}
开发者ID:czjin,项目名称:bbpark,代码行数:12,代码来源:accountsrecharge.cpp


示例10: getAllJson

QJsonArray ParkAttendants::getAllJson()
{
    QJsonArray array;
    TSqlORMapper<ParkAttendantsObject> mapper;

    if (mapper.find() > 0) {
        for (TSqlORMapperIterator<ParkAttendantsObject> i(mapper); i.hasNext(); ) {
            array.append(QJsonValue(QJsonObject::fromVariantMap(ParkAttendants(i.next()).toVariantMap())));
        }
    }
    return array;
}
开发者ID:czjin,项目名称:bbpark,代码行数:12,代码来源:parkattendants.cpp


示例11: getAllJson

QJsonArray UserVehicle::getAllJson()
{
    QJsonArray array;
    TSqlORMapper<UserVehicleObject> mapper;

    if (mapper.find() > 0) {
        for (TSqlORMapperIterator<UserVehicleObject> i(mapper); i.hasNext(); ) {
            array.append(QJsonValue(QJsonObject::fromVariantMap(UserVehicle(i.next()).toVariantMap())));
        }
    }
    return array;
}
开发者ID:czjin,项目名称:bbpark,代码行数:12,代码来源:uservehicle.cpp


示例12: count

void ChatLog::removeOldLogs(int remainingCount)
{
    int del = count() - remainingCount;
    if (del > 0) {
        TSqlORMapper<ChatLogObject> mapper;
        mapper.setSortOrder(ChatLogObject::Id, Tf::DescendingOrder);
        auto log = mapper.findFirst();
        int maxId = log.id;

        TCriteria ctr(ChatLogObject::Id, TSql::LessEqual, maxId - remainingCount);
        mapper.removeAll(ctr);
    }
}
开发者ID:treefrogframework,项目名称:chatapp,代码行数:13,代码来源:chatlog.cpp


示例13: store

bool TSessionSqlObjectStore::store(TSession &session)
{
    TSqlORMapper<TSessionObject> mapper;
    TCriteria cri(TSessionObject::Id, TSql::Equal, session.id());
    TSessionObject so = mapper.findFirst(cri);

    QDataStream ds(&so.data, QIODevice::WriteOnly);
    ds << *static_cast<const QVariantHash *>(&session);

    if (so.isEmpty()) {
        so.id = session.id();
        return so.create();
    }
    return so.update();
}
开发者ID:Keloran,项目名称:treefrog-framework,代码行数:15,代码来源:tsessionsqlobjectstore.cpp


示例14: find

TSession TSessionSqlObjectStore::find(const QByteArray &id, const QDateTime &modified)
{
    TSqlORMapper<TSessionObject> mapper;
    TCriteria cri;
    cri.add(TSessionObject::Id, TSql::Equal, id);
    cri.add(TSessionObject::UpdatedAt, TSql::GreaterEqual, modified);

    TSessionObject sess = mapper.findFirst(cri);
    if (sess.isEmpty())
        return TSession();
    
    TSession result(id);
    QDataStream ds(&sess.data, QIODevice::ReadOnly);
    ds >> *static_cast<QVariantHash *>(&result);
    return result;  
}
开发者ID:Keloran,项目名称:treefrog-framework,代码行数:16,代码来源:tsessionsqlobjectstore.cpp


示例15: find

TSession TSessionSqlObjectStore::find(const QByteArray &id)
{
    QDateTime modified = QDateTime::currentDateTime().addSecs(-lifeTimeSecs());
    TSqlORMapper<TSessionObject> mapper;
    TCriteria cri;
    cri.add(TSessionObject::Id, TSql::Equal, id);
    cri.add(TSessionObject::UpdatedAt, TSql::GreaterEqual, modified);

    TSessionObject so = mapper.findFirst(cri);
    if (so.isNull()) {
        return TSession();
    }

    TSession session(id);
    QDataStream ds(&so.data, QIODevice::ReadOnly);
    ds >> *static_cast<QVariantMap *>(&session);

    if (ds.status() != QDataStream::Ok) {
        tSystemError("Failed to load a session from the sqlobject store.");
    }
    return session;
}
开发者ID:skipbit,项目名称:treefrog-framework,代码行数:22,代码来源:tsessionsqlobjectstore.cpp


示例16: get

VMenusGroupMenuRole VMenusGroupMenuRole::get(int roleId, int menusGroupOrder, int menusGroupId, const QString &menusGroupCd, const QString &menusGroupNameZh, const QString &menusGroupNameEn, const QString &menusGroupTooltip, const QString &menusGroupDesc, int menuId, int menuOrder, const bool &breakBool, const QString &menuCd, const QString &menuNameZh, const QString &menuNameEn, const QString &menuTooltip, const QString &menuDesc, const QString &controller, const QString &action)
{
    TCriteria cri;
    cri.add(VMenusGroupMenuRoleObject::RoleId, roleId);
    cri.add(VMenusGroupMenuRoleObject::MenusGroupOrder, menusGroupOrder);
    cri.add(VMenusGroupMenuRoleObject::MenusGroupId, menusGroupId);
    cri.add(VMenusGroupMenuRoleObject::MenusGroupCd, menusGroupCd);
    cri.add(VMenusGroupMenuRoleObject::MenusGroupNameZh, menusGroupNameZh);
    cri.add(VMenusGroupMenuRoleObject::MenusGroupNameEn, menusGroupNameEn);
    cri.add(VMenusGroupMenuRoleObject::MenusGroupTooltip, menusGroupTooltip);
    cri.add(VMenusGroupMenuRoleObject::MenusGroupDesc, menusGroupDesc);
    cri.add(VMenusGroupMenuRoleObject::MenuId, menuId);
    cri.add(VMenusGroupMenuRoleObject::MenuOrder, menuOrder);
    cri.add(VMenusGroupMenuRoleObject::BreakBool, breakBool);
    cri.add(VMenusGroupMenuRoleObject::MenuCd, menuCd);
    cri.add(VMenusGroupMenuRoleObject::MenuNameZh, menuNameZh);
    cri.add(VMenusGroupMenuRoleObject::MenuNameEn, menuNameEn);
    cri.add(VMenusGroupMenuRoleObject::MenuTooltip, menuTooltip);
    cri.add(VMenusGroupMenuRoleObject::MenuDesc, menuDesc);
    cri.add(VMenusGroupMenuRoleObject::Controller, controller);
    cri.add(VMenusGroupMenuRoleObject::Action, action);
    TSqlORMapper<VMenusGroupMenuRoleObject> mapper;
    return VMenusGroupMenuRole(mapper.findFirst(cri));
}
开发者ID:hks2002,项目名称:AM,代码行数:24,代码来源:vmenusgroupmenurole.cpp


示例17: count

int EvtVendor::count()
{
    TSqlORMapper<EvtVendorObject> mapper;
    return mapper.findCount();
}
开发者ID:hks2002,项目名称:AM,代码行数:5,代码来源:evtvendor.cpp


示例18: get

EvtVendor EvtVendor::get(int eventId, int vendorId)
{
    TSqlORMapper<EvtVendorObject> mapper;
    return EvtVendor(mapper.findByPrimaryKey(QVariantList()<<QVariant(eventId)<<QVariant(vendorId)));
}
开发者ID:hks2002,项目名称:AM,代码行数:5,代码来源:evtvendor.cpp


示例19: count

int TaskSchedRuleMesur::count()
{
    TSqlORMapper<TaskSchedRuleMesurObject> mapper;
    return mapper.findCount();
}
开发者ID:hks2002,项目名称:AM,代码行数:5,代码来源:taskschedrulemesur.cpp


示例20: get

TaskSchedRuleMesur TaskSchedRuleMesur::get(int taskId, int dataTypeId, int mesurUnitId)
{
    TSqlORMapper<TaskSchedRuleMesurObject> mapper;
    return TaskSchedRuleMesur(mapper.findByPrimaryKey(QVariantList()<<QVariant(taskId)<<QVariant(dataTypeId)<<QVariant(mesurUnitId)));
}
开发者ID:hks2002,项目名称:AM,代码行数:5,代码来源:taskschedrulemesur.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TStack类代码示例发布时间:2022-05-31
下一篇:
C++ TSpectrum类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap