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


Java Order类代码示例

本文整理汇总了Java中org.alfresco.repo.search.impl.querymodel.Order的典型用法代码示例。如果您正苦于以下问题:Java Order类的具体用法?Java Order怎么用?Java Order使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Order类属于org.alfresco.repo.search.impl.querymodel包,在下文中一共展示了Order类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testOrderableProperty

import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
private void testOrderableProperty(String propertyQueryName)
{
    testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " ASC", 13, false, Order.ASCENDING, CMISQueryMode.CMS_STRICT,
            propertyQueryName);
    testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " DESC", 13, false, Order.DESCENDING, CMISQueryMode.CMS_STRICT,
            propertyQueryName);
    testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " DESC", 13, true, Order.ASCENDING, CMISQueryMode.CMS_STRICT,
            propertyQueryName);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:10,代码来源:OpenCmisQueryTest.java

示例2: testOrderablePropertyFail

import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
private void testOrderablePropertyFail(String propertyQueryName)
{
    testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " ASC", 13, true, Order.ASCENDING, CMISQueryMode.CMS_STRICT,
            propertyQueryName);
    testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " DESC", 13, true, Order.DESCENDING, CMISQueryMode.CMS_STRICT,
            propertyQueryName);
    testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " DESC", 13, true, Order.ASCENDING, CMISQueryMode.CMS_STRICT,
            propertyQueryName);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:10,代码来源:OpenCmisQueryTest.java

示例3: buildSortDefinitions

import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
public List<SortDefinition> buildSortDefinitions(Set<String> selectors, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
{
    if ((getOrderings() == null) || (getOrderings().size() == 0))
    {
        return Collections.<SortDefinition>emptyList();
    }

    ArrayList<SortDefinition> definitions = new ArrayList<SortDefinition>(getOrderings().size());

    for (Ordering ordering : getOrderings())
    {
        if (ordering.getColumn().getFunction().getName().equals(PropertyAccessor.NAME))
        {
            PropertyArgument property = (PropertyArgument) ordering.getColumn().getFunctionArguments().get(PropertyAccessor.ARG_PROPERTY);

            if (property == null)
            {
                throw new IllegalStateException();
            }

            String propertyName = property.getPropertyName();

            String fieldName = functionContext.getLuceneFieldName(propertyName);
            
            definitions.add(new SortDefinition(SortType.FIELD, fieldName, ordering.getOrder() == Order.ASCENDING));
        }
        else if (ordering.getColumn().getFunction().getName().equals(Score.NAME))
        {
            definitions.add(new SortDefinition(SortType.SCORE, null, ordering.getOrder() == Order.ASCENDING));
        }
    }

    return definitions;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:35,代码来源:LuceneQuery.java

示例4: DBOrdering

import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
/**
 * @param column Column
 * @param order Order
 */
public DBOrdering(Column column, Order order)
{
    super(column, order);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:9,代码来源:DBOrdering.java

示例5: createOrdering

import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
@Override
public Ordering createOrdering(Column column, Order order)
{
    return new DBOrdering(column, order);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:6,代码来源:DBQueryModelFactory.java

示例6: BaseOrdering

import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
public BaseOrdering(Column column, Order order)
{
    this.column = column;
    this.order = order;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:6,代码来源:BaseOrdering.java

示例7: getOrder

import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
public Order getOrder()
{
   return order;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:5,代码来源:BaseOrdering.java

示例8: LuceneOrdering

import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
/**
 * @param column Column
 * @param order Order
 */
public LuceneOrdering(Column column, Order order)
{
    super(column, order);
    // TODO Auto-generated constructor stub
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:10,代码来源:LuceneOrdering.java

示例9: createOrdering

import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
public Ordering createOrdering(Column column, Order order)
{
    return new LuceneOrdering(column, order);
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:5,代码来源:LuceneQueryModelFactory.java

示例10: buildSort

import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
@Override
public Sort buildSort(List<Ordering> orderings, FunctionEvaluationContext functionContext) throws ParseException
{
    int index = 0;
    SortField[] fields = new SortField[orderings.size()];

    for (Ordering ordering : orderings)
    {
        if (ordering.getColumn().getFunction().getName().equals(PropertyAccessor.NAME))
        {
            PropertyArgument property = (PropertyArgument) ordering.getColumn().getFunctionArguments().get(PropertyAccessor.ARG_PROPERTY);

            if (property == null)
            {
                throw new IllegalStateException();
            }

            String propertyName = property.getPropertyName();

            String luceneField = functionContext.getLuceneSortField(this, propertyName);

            if (luceneField != null)
            {
                if (LuceneUtils.fieldHasTerm(lqp.getIndexReader(), luceneField))
                {
                    Locale locale = this.getSearchParameters().getSortLocale();
                    fields[index++] = new SortField(luceneField, locale, (ordering.getOrder() == Order.DESCENDING));
                }
                else
                {
                    fields[index++] = new SortField(null, SortField.DOC, (ordering.getOrder() == Order.DESCENDING));
                }
            }
            else
            {
                throw new IllegalStateException();
            }
        }
        else if (ordering.getColumn().getFunction().getName().equals(Score.NAME))
        {
            fields[index++] = new SortField(null, SortField.SCORE, !(ordering.getOrder() == Order.DESCENDING));
        }
        else
        {
            throw new IllegalStateException();
        }

    }

    return new Sort(fields);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:52,代码来源:LegacyLuceneQueryParserAdaptor.java


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