Examples of IndexCondition


Examples of info.archinnov.achilles.type.IndexCondition

        CompleteBean entity2 = CompleteBeanTestBuilder.builder().randomId().name("John DOO").buid();

        manager.insert(entity1);
        manager.insert(entity2);

        IndexCondition condition = new IndexCondition("name", "John DOO");
        List<CompleteBean> actual = manager.indexedQuery(CompleteBean.class, condition).get();

        assertThat(actual).hasSize(1);

        CompleteBean found1 = actual.get(0);
View Full Code Here

Examples of info.archinnov.achilles.type.IndexCondition

        manager.insert(entity1);
        manager.insert(entity2);
        manager.insert(entity3);

        //When
        IndexCondition condition = new IndexCondition("consistencylevel", EACH_QUORUM);
        final List<EntityWithSecondaryIndexOnEnum> actual = manager.indexedQuery(EntityWithSecondaryIndexOnEnum.class, condition).get();

        //Then
        assertThat(actual).hasSize(2);
        final EntityWithSecondaryIndexOnEnum found1 = actual.get(0);
View Full Code Here

Examples of info.archinnov.achilles.type.IndexCondition

    }

    @Test
    public void should_throw_clustered_exception_for_indexed_query() throws Exception {
        IndexCondition condition = new IndexCondition("name", "John DOO");

        exception.expect(AchillesException.class);
        exception.expectMessage("Index query is not supported for clustered entity");

        manager.indexedQuery(ClusteredEntity.class, condition).get();
View Full Code Here

Examples of info.archinnov.achilles.type.IndexCondition

    @Test
    public void should_encode_index_condition_value() throws Exception {
        //Given
        PropertyMeta nameMeta = mock(PropertyMeta.class, RETURNS_DEEP_STUBS);
        IndexCondition indexCondition = spy(new IndexCondition("name", "DuyHai"));

        when(meta.getAllMetasExceptCounters()).thenReturn(asList(nameMeta));
        when(nameMeta.getCQL3ColumnName()).thenReturn("name");
        when(nameMeta.getPropertyName()).thenReturn("name");
        when(nameMeta.forTranscoding().encodeToCassandra("DuyHai")).thenReturn("DuyHai");
View Full Code Here

Examples of org.dbwiki.data.query.xpath.IndexCondition

        try {
          index = Integer.parseInt(conditionToken.children().firstElement().value());
        } catch (java.lang.NumberFormatException nfe) {
          throw new WikiQueryException(WikiQueryException.InvalidQueryStatement, "Invalid number format " + conditionToken.children().firstElement().value());
        }
        pathElement = new XPathComponent(entity, new IndexCondition(index));
      } else {
        Condition condition = null;
        if (conditionToken.children().size() > 1) {
          Conjunction conjunction = new Conjunction();
          for (int iCondition = 0; iCondition < conditionToken.children().size(); iCondition++) {
View Full Code Here

Examples of org.dbwiki.data.query.xpath.IndexCondition

        try {
          index = Integer.parseInt(conditionToken.children().firstElement().value());
        } catch (java.lang.NumberFormatException nfe) {
          throw new WikiQueryException(WikiQueryException.InvalidQueryStatement, "Invalid number format " + conditionToken.children().firstElement().value());
        }
        pathElement = new XPathComponent(rootEntity, new IndexCondition(index));
      } else {
        Condition condition = null;
        if (conditionToken.children().size() > 1) {
          Conjunction conjunction = new Conjunction();
          for (int iCondition = 0; iCondition < conditionToken.children().size(); iCondition++) {
View Full Code Here

Examples of org.h2.index.IndexCondition

    }

    public void createIndexConditions(Session session, TableFilter filter) {
        TableFilter tf = getTableFilter();
        if (filter == tf && column.getType() == Value.BOOLEAN) {
            IndexCondition cond = IndexCondition.get(Comparison.EQUAL, this, ValueExpression
                    .get(ValueBoolean.get(true)));
            filter.addIndexCondition(cond);
        }
    }
View Full Code Here

Examples of org.h2.index.IndexCondition

     */
    public void prepare() {
        // forget all unused index conditions
        // the indexConditions list may be modified here
        for (int i = 0; i < indexConditions.size(); i++) {
            IndexCondition condition = indexConditions.get(i);
            if (!condition.isAlwaysFalse()) {
                Column col = condition.getColumn();
                if (col.getColumnId() >= 0) {
                    if (index.getColumnIndex(col) < 0) {
                        indexConditions.remove(i);
                        i--;
                    }
View Full Code Here

Examples of org.h2.index.IndexCondition

     * Remove all index conditions that are not used by the current index.
     */
    void removeUnusableIndexConditions() {
        // the indexConditions list may be modified here
        for (int i = 0; i < indexConditions.size(); i++) {
            IndexCondition cond = indexConditions.get(i);
            if (!cond.isEvaluatable()) {
                indexConditions.remove(i--);
            }
        }
    }
View Full Code Here

Examples of org.h2.index.IndexCondition

    }

    public void createIndexConditions(Session session, TableFilter filter) {
        TableFilter tf = getTableFilter();
        if (filter == tf && column.getType() == Value.BOOLEAN) {
            IndexCondition cond = IndexCondition.get(Comparison.EQUAL, this, ValueExpression
                    .get(ValueBoolean.get(true)));
            filter.addIndexCondition(cond);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.