Search in sources :

Example 1 with NotIndexed

use of org.infinispan.query.dsl.embedded.testdomain.NotIndexed in project infinispan by infinispan.

the class EmbeddedRemoteInteropQueryTest method testEmbeddedQueryForEmbeddedEntryOnNonIndexedType.

public void testEmbeddedQueryForEmbeddedEntryOnNonIndexedType() {
    cache.put(1, new NotIndexed("testing 123"));
    // get user back from remote cache via query and check its attributes
    QueryFactory qf = org.infinispan.query.Search.getQueryFactory(cache);
    Query<NotIndexed> query = qf.create("FROM " + NotIndexed.class.getName() + " WHERE notIndexedField LIKE '%123%'");
    List<NotIndexed> list = query.execute().list();
    assertNotNull(list);
    assertEquals(1, list.size());
    assertNotNull(list.get(0));
    assertEquals("testing 123", list.get(0).notIndexedField);
}
Also used : QueryFactory(org.infinispan.query.dsl.QueryFactory) NotIndexed(org.infinispan.query.dsl.embedded.testdomain.NotIndexed)

Example 2 with NotIndexed

use of org.infinispan.query.dsl.embedded.testdomain.NotIndexed in project infinispan by infinispan.

the class QueryStringTest method testDeleteByQueryOnNonIndexedType.

public void testDeleteByQueryOnNonIndexedType() {
    getCacheForWrite().put("notIndexedToBeDeleted", new NotIndexed("testing delete"));
    Query<NotIndexed> select = createQueryFromString("FROM " + NotIndexed.class.getName() + " WHERE notIndexedField = 'testing delete'");
    assertEquals(OptionalLong.of(1), select.execute().hitCount());
    Query<Transaction> delete = createQueryFromString("DELETE FROM " + NotIndexed.class.getName() + " WHERE notIndexedField = 'testing delete'");
    assertEquals(1, delete.executeStatement());
    assertEquals(OptionalLong.of(0), select.execute().hitCount());
}
Also used : Transaction(org.infinispan.query.dsl.embedded.testdomain.Transaction) NotIndexed(org.infinispan.query.dsl.embedded.testdomain.NotIndexed)

Example 3 with NotIndexed

use of org.infinispan.query.dsl.embedded.testdomain.NotIndexed in project infinispan by infinispan.

the class EmbeddedRemoteInteropQueryTest method testRemoteQueryForEmbeddedEntryOnNonIndexedType.

public void testRemoteQueryForEmbeddedEntryOnNonIndexedType() {
    cache.put(1, new NotIndexed("testing 123"));
    // get user back from remote cache via query and check its attributes
    QueryFactory qf = Search.getQueryFactory(remoteCache);
    Query<NotIndexed> query = qf.create("FROM sample_bank_account.NotIndexed WHERE notIndexedField LIKE '%123%'");
    List<NotIndexed> list = query.execute().list();
    assertNotNull(list);
    assertEquals(1, list.size());
    assertNotNull(list.get(0));
    assertEquals("testing 123", list.get(0).notIndexedField);
}
Also used : QueryFactory(org.infinispan.query.dsl.QueryFactory) NotIndexed(org.infinispan.query.dsl.embedded.testdomain.NotIndexed)

Example 4 with NotIndexed

use of org.infinispan.query.dsl.embedded.testdomain.NotIndexed in project infinispan by infinispan.

the class RemoteQueryDisableIndexingTest method populateCache.

@BeforeClass
protected void populateCache() {
    getCacheForWrite().put("notIndexed1", new NotIndexed("testing 123"));
    getCacheForWrite().put("notIndexed2", new NotIndexed("xyz"));
}
Also used : NotIndexed(org.infinispan.query.dsl.embedded.testdomain.NotIndexed) BeforeClass(org.testng.annotations.BeforeClass)

Example 5 with NotIndexed

use of org.infinispan.query.dsl.embedded.testdomain.NotIndexed in project infinispan by infinispan.

the class RemoteQueryStringTest method testDeleteByQueryOnNonIndexedType.

@Override
public void testDeleteByQueryOnNonIndexedType() {
    getCacheForWrite().put("notIndexedToBeDeleted", new NotIndexed("testing delete"));
    Query<NotIndexed> select = createQueryFromString("FROM sample_bank_account.NotIndexed WHERE notIndexedField = 'testing delete'");
    assertEquals(OptionalLong.of(1), select.execute().hitCount());
    Query<Transaction> delete = createQueryFromString("DELETE FROM sample_bank_account.NotIndexed WHERE notIndexedField = 'testing delete'");
    assertEquals(1, delete.executeStatement());
    assertEquals(OptionalLong.of(0), select.execute().hitCount());
}
Also used : Transaction(org.infinispan.query.dsl.embedded.testdomain.Transaction) NotIndexed(org.infinispan.query.dsl.embedded.testdomain.NotIndexed)

Aggregations

NotIndexed (org.infinispan.query.dsl.embedded.testdomain.NotIndexed)9 Transaction (org.infinispan.query.dsl.embedded.testdomain.Transaction)5 BeforeClass (org.testng.annotations.BeforeClass)4 QueryFactory (org.infinispan.query.dsl.QueryFactory)3 Address (org.infinispan.query.dsl.embedded.testdomain.Address)3 User (org.infinispan.query.dsl.embedded.testdomain.User)3 Account (org.infinispan.query.dsl.embedded.testdomain.Account)2 EmbeddedQueryFactory (org.infinispan.query.core.impl.EmbeddedQueryFactory)1 Query (org.infinispan.query.dsl.Query)1 TheEntity (org.infinispan.query.dsl.embedded.impl.model.TheEntity)1 Author (org.infinispan.query.dsl.embedded.testdomain.Author)1 Book (org.infinispan.query.dsl.embedded.testdomain.Book)1 AccountHS (org.infinispan.query.dsl.embedded.testdomain.hsearch.AccountHS)1 AddressHS (org.infinispan.query.dsl.embedded.testdomain.hsearch.AddressHS)1 TransactionHS (org.infinispan.query.dsl.embedded.testdomain.hsearch.TransactionHS)1 UserHS (org.infinispan.query.dsl.embedded.testdomain.hsearch.UserHS)1