PartialSQLiteIndex extends PartialSortedKeyStatisticsAttributeIndex<A, O> implements NonHeapTypeIndex { protected PartialSQLiteIndex(Attribute<O, A> attribute, SimpleAttribute<O, K> primaryKeyAttribute, SimpleAttribute<K, O> foreignKeyAttribute, Query<O> filterQuery) { super(attribute, filterQuery); this.primaryKeyAttribute = primaryKeyAttribute; this.foreignKeyAttribute = foreignKeyAttribute; this.tableNameSuffix = "_partial_" + sanitizeForTableName(filterQuery.toString()); } protected  PartialSQLiteIndex(Attribute<O, A> attribute,
                                 SimpleAttribute<O, K> primaryKeyAttribute,
                                 SimpleAttribute<K, O> foreignKeyAttribute,
                                 Query<O> filterQuery); static PartialSQLiteIndex<A, O, K> onAttributeWithFilterQuery(Attribute<O, A> attribute,
                                                                                   SimpleAttribute<O, K> primaryKeyAttribute,
                                                                                   SimpleAttribute<K, O> foreignKeyAttribute,
                                                                                   Query<O> filterQuery);  }
@Test public void testPartialSQLiteIndex() { IndexedCollection<Car> indexedCollection = new ConcurrentIndexedCollection<Car>(); ConnectionManager connectionManager = temporaryInMemoryDatabase.getConnectionManager(true); QueryOptions queryOptions = new QueryOptions(); queryOptions.put(ConnectionManager.class, connectionManager); PartialSQLiteIndex<String, Car, Integer> index = PartialSQLiteIndex.onAttributeWithFilterQuery(Car.MANUFACTURER, OBJECT_TO_ID, ID_TO_OBJECT, between(Car.CAR_ID, 2, 4)); indexedCollection.addIndex(index, queryOptions); indexedCollection.update(Collections.<Car>emptySet(), CarFactory.createCollectionOfCars(10), queryOptions); assertEquals(75, indexedCollection.retrieve(and(equal(Car.MANUFACTURER, "Ford"), between(Car.CAR_ID, 2, 4)), queryOptions).getRetrievalCost()); assertEquals(2147483647, indexedCollection.retrieve(and(equal(Car.MANUFACTURER, "Ford"), between(Car.CAR_ID, 2, 5)), queryOptions).getRetrievalCost()); }