Exemplo n.º 1
0
Yb::ElementTree::ElementPtr ping(
        Yb::Session &session, Yb::ILogger &logger,
        const Yb::StringDict &params)
{
    session.engine()->exec_select("select 1 from dual", Yb::Values());
    Yb::ElementTree::ElementPtr resp = mk_resp("success");
    return resp;
}
ScheduleGroup::ScheduleGroup(Yb::Session &session)
    : Yb::DomainObject(session.schema(), _T("T_SCHEDULE_GROUP"))
// AUTOGEN_BEGIN(005) {
    , id(this)
    , schedule(this, _T("schedule"))
    , group(this, _T("group"))
// } AUTOGEN_END
{
// AUTOGEN_BEGIN(006) {
// } AUTOGEN_END
    save(session);
}
Exemplo n.º 3
0
Subject::Subject(Yb::Session &session)
    : Yb::DomainObject(session.schema(), _T("T_SUBJECT"))
// AUTOGEN_BEGIN(005) {
    , id(this)
    , name(this)
    , short_name(this)
    , classes(this, _T("classes"))
// } AUTOGEN_END
{
// AUTOGEN_BEGIN(006) {
// } AUTOGEN_END
    save(session);
}
ScheduleGroup::ListPtr
ScheduleGroup::find(Yb::Session &session,
        const Yb::Expression &filter, const Yb::Expression &order_by)
{
    ScheduleGroup::ListPtr lst(new ScheduleGroup::List());
    Yb::ObjectList rows;
    session.load_collection(rows, Yb::Expression(_T("T_SCHEDULE_GROUP")), filter, order_by);
    if (rows.size()) {
        Yb::ObjectList::iterator it = rows.begin(), end = rows.end();
        for (; it != end; ++it)
            lst->push_back(ScheduleGroup(*it));
    }
    return lst;
}
Exemplo n.º 5
0
User::ListPtr
User::find(Yb::Session &session,
           const Yb::Expression &filter, const Yb::Expression &order_by)
{
    User::ListPtr lst(new User::List());
    Yb::ObjectList rows;
    session.load_collection(rows, Yb::Expression(_T("T_USER")), filter, order_by);
    if (rows.size()) {
        Yb::ObjectList::iterator it = rows.begin(), end = rows.end();
        for (; it != end; ++it)
            lst->push_back(User(*it));
    }
    return lst;
}
Exemplo n.º 6
0
User::User(Yb::Session &session)
    : Yb::DomainObject(session.schema(), _T("T_USER"))
// AUTOGEN_BEGIN(005) {
    , id(this)
    , name(this)
    , pass(this)
    , email(this)
    , login(this)
    , status(this)
    , facult(this)
    , is_superuser(this)
    , phone(this)
    , login_sessions(this, _T("login_sessions"))
    , classes(this, _T("classes"))
    , subscriptions(this, _T("subscriptions"))
// } AUTOGEN_END
{
// AUTOGEN_BEGIN(006) {
    set(5, Yb::Value((Yb::LongInt)1));
    set(6, Yb::Value((Yb::LongInt)1));
    set(7, Yb::Value((Yb::LongInt)0));
// } AUTOGEN_END
    save(session);
}