本文整理汇总了C++中SelectQuery::addOrderField方法的典型用法代码示例。如果您正苦于以下问题:C++ SelectQuery::addOrderField方法的具体用法?C++ SelectQuery::addOrderField怎么用?C++ SelectQuery::addOrderField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SelectQuery
的用法示例。
在下文中一共展示了SelectQuery::addOrderField方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Search
TimetableRowTableSync::SearchResult TimetableRowTableSync::Search(
Env& env,
optional<RegistryKeyType> timetableId
, bool orderByTimetable
, bool raisingOrder
, int first
, boost::optional<std::size_t> number,
LinkLevel linkLevel
){
SelectQuery<TimetableRowTableSync> query;
// Selection
if (timetableId)
{
query.addWhereField(COL_TIMETABLE_ID, *timetableId);
}
// Ordering
if (orderByTimetable)
{
query.addOrderField(COL_TIMETABLE_ID, raisingOrder);
query.addOrderField(COL_RANK, raisingOrder);
}
// Size
if (number)
query.setNumber(*number + 1);
if (first > 0)
query.setFirst(first);
return LoadFromQuery(query, env, linkLevel);
}
示例2: Search
InterSYNTHESESlaveTableSync::SearchResult InterSYNTHESESlaveTableSync::Search(
Env& env,
std::string name
, int first /*= 0*/,
boost::optional<std::size_t> number
, bool orderByName
, bool raisingOrder,
LinkLevel linkLevel
){
SelectQuery<InterSYNTHESESlaveTableSync> query;
if (!name.empty())
{
query.addWhereField(SimpleObjectFieldDefinition<Name>::FIELD.name, name, ComposedExpression::OP_LIKE);
}
if (orderByName)
{
query.addOrderField(SimpleObjectFieldDefinition<Name>::FIELD.name, raisingOrder);
}
if (number)
{
query.setNumber(*number + 1);
}
if (first > 0)
{
query.setFirst(first);
}
return LoadFromQuery(query, env, linkLevel);
}
示例3: Search
MapSourceTableSync::SearchResult MapSourceTableSync::Search(
util::Env& env,
optional<string> name,
size_t first /*= 0*/,
optional<size_t> number /*= boost::optional<std::size_t>()*/,
bool orderByName,
bool raisingOrder,
util::LinkLevel linkLevel
){
SelectQuery<MapSourceTableSync> query;
if(name)
{
query.addWhereField(COL_NAME, *name, ComposedExpression::OP_LIKE);
}
if(orderByName)
{
query.addOrderField(COL_NAME, raisingOrder);
}
if (number)
{
query.setNumber(*number + 1);
}
if (first > 0)
{
query.setFirst(first);
}
return LoadFromQuery(query, env, linkLevel);
}
示例4: LoadFromQuery
DriverAllocationTemplateTableSync::SearchResult DriverAllocationTemplateTableSync::Search(
util::Env& env,
boost::gregorian::date date /*= boost::gregorian::date(not_a_date_time)*/,
size_t first /*= 0*/,
boost::optional<std::size_t> number /*= boost::optional<std::size_t>()*/,
bool orderByDate /*= true*/,
bool raisingOrder /*= true*/,
util::LinkLevel linkLevel /*= util::UP_LINKS_LOAD_LEVEL */
) {
SelectQuery<DriverAllocationTemplateTableSync> query;
if (!date.is_not_a_date())
{
query.addWhereField(SimpleObjectFieldDefinition<Date>::FIELD.name, to_iso_extended_string(date));
}
if (orderByDate)
{
query.addOrderField(SimpleObjectFieldDefinition<Date>::FIELD.name, raisingOrder);
}
if (number)
{
query.setNumber(*number + 1);
}
if (first > 0)
{
query.setFirst(first);
}
return LoadFromQuery(query, env, linkLevel);
}
示例5: Search
TimetableRowGroupItemTableSync::SearchResult TimetableRowGroupItemTableSync::Search(
util::Env& env,
boost::optional<util::RegistryKeyType> timetableRowGroupId,
boost::optional<size_t> rank,
int first,
boost::optional<std::size_t> number,
bool orderByRank,
bool raisingOrder,
util::LinkLevel linkLevel
){
SelectQuery<TimetableRowGroupItemTableSync> query;
if (timetableRowGroupId)
{
query.addWhereField(SimpleObjectFieldDefinition<TimetableRowGroup>::FIELD.name, *timetableRowGroupId);
}
if(rank)
{
query.addWhereField(SimpleObjectFieldDefinition<Rank>::FIELD.name, *rank);
}
if(orderByRank)
{
query.addOrderField(SimpleObjectFieldDefinition<Rank>::FIELD.name, raisingOrder);
}
if (number)
{
query.setNumber(*number + 1);
if (first > 0)
query.setFirst(first);
}
return LoadFromQuery(query, env, linkLevel);
}
示例6: Search
PermanentThreadTableSync::SearchResult PermanentThreadTableSync::Search(
Env& env,
int first /*= 0*/
, optional<size_t> number /*= 0*/
, bool orderByName
, bool raisingOrder,
LinkLevel linkLevel
){
SelectQuery<PermanentThreadTableSync> query;
if (orderByName)
{
query.addOrderField(Name::FIELD.name, raisingOrder);
}
if (number)
{
query.setNumber(*number + 1);
}
if (first > 0)
{
query.setFirst(first);
}
return LoadFromQuery(query, env, linkLevel);
}