Package org.lilyproject.repository.api

Examples of org.lilyproject.repository.api.Record


        );

        LilyIndexerConf idxConf = LilyIndexerConfBuilder.build(new ByteArrayInputStream(conf.getBytes()), repository);

        // There are no conditions on variant properties, so a record id with variant properties should pass
        Record recordProp1 = repository.getDefaultTable().recordBuilder()
                .id("record", ImmutableMap.of("prop1", "val1"))
                .recordType(new QName("ns1", "typeA"))
                .field(new QName("ns", "string"), "something")
                .build();
View Full Code Here


                Lists.newArrayList("recordType='ns2:*'")
        );

        LilyIndexerConf idxConf = LilyIndexerConfBuilder.build(new ByteArrayInputStream(conf.getBytes()), repository);

        Record recordNs1TypeA = newRecordOfType(new QName("ns1", "typeA"));
        Record recordNs2TypeA = newRecordOfType(new QName("ns2", "typeA"));

        assertNotNull(idxConf.getRecordFilter().getIndexCase(Table.RECORD.name, recordNs1TypeA));
        assertNull(idxConf.getRecordFilter().getIndexCase(Table.RECORD.name, recordNs2TypeA));
    }
View Full Code Here

                Collections.<String>emptyList()
        );

        LilyIndexerConf idxConf = LilyIndexerConfBuilder.build(new ByteArrayInputStream(conf.getBytes()), repository);

        Record record1 = repository.getDefaultTable().recordBuilder()
                .id("record", ImmutableMap.of("prop1", "val1"))
                .recordType(new QName("ns1", "typeA"))
                .field(new QName("ns", "int"), new Integer(10))
                .build();

        assertNotNull(idxConf.getRecordFilter().getIndexCase(Table.RECORD.name, record1));

        Record record2 = repository.getDefaultTable().recordBuilder()
                .id("record", ImmutableMap.of("prop1", "val1"))
                .recordType(new QName("ns1", "typeA"))
                .field(new QName("ns", "int"), new Integer(11))
                .build();

        assertNull(idxConf.getRecordFilter().getIndexCase(Table.RECORD.name, record2));

        Record record3 = repository.getDefaultTable().recordBuilder()
                .id("record", ImmutableMap.of("prop1", "val1"))
                .recordType(new QName("ns1", "typeB"))
                .field(new QName("ns", "int"), new Integer(10))
                .build();

        assertNull(idxConf.getRecordFilter().getIndexCase(Table.RECORD.name, record3));

        Record record4 = repository.getDefaultTable().recordBuilder()
                .id("record", ImmutableMap.of("prop1", "val2"))
                .recordType(new QName("ns1", "typeA"))
                .field(new QName("ns", "int"), new Integer(10))
                .build();
View Full Code Here

        );

        LilyIndexerConf idxConf = LilyIndexerConfBuilder.build(new ByteArrayInputStream(conf.getBytes()), repository);

        // A record of any type with any number of variant properties should match
        Record record1 = repository.getDefaultTable().recordBuilder()
                .id("record", ImmutableMap.of("prop1", "val1"))
                .recordType(new QName("ns1", "typeA"))
                .field(new QName("ns", "int"), new Integer(10))
                .build();
View Full Code Here

        );

        LilyIndexerConf idxConf = LilyIndexerConfBuilder.build(new ByteArrayInputStream(conf.getBytes()), repository);

        // A record of any type with any number of variant properties should match
        Record record1 = repository.getDefaultTable().recordBuilder()
                .id("record", ImmutableMap.of("prop1", "val1"))
                .recordType(new QName("ns1", "typeA"))
                .field(new QName("ns", "int"), new Integer(10))
                .build();
View Full Code Here

                        Lists.<String>newArrayList());


        LilyIndexerConf idxConf = LilyIndexerConfBuilder.build(new ByteArrayInputStream(conf.getBytes()), repository);

        Record record = repository.getDefaultTable().recordBuilder().id("record").field(new QName("ns", "int"), new Integer(42)).build();

        assertNotNull(idxConf.getRecordFilter().getIndexCase("myrecordtable", record));
    }
View Full Code Here

                Lists.newArrayList("vtags='last' tables='myrecordtable'"),
                Lists.<String>newArrayList());

        LilyIndexerConf idxConf = LilyIndexerConfBuilder.build(new ByteArrayInputStream(conf.getBytes()), repository);

        Record record = repository.getDefaultTable().recordBuilder().id("record").field(new QName("ns", "int"), new Integer(42)).build();

        assertNull(idxConf.getRecordFilter().getIndexCase("notmyrecordtable", record));
    }
View Full Code Here

                Lists.newArrayList("vtags='last'"),
                Lists.newArrayList("tables='myrecordtable'"));

        LilyIndexerConf idxConf = LilyIndexerConfBuilder.build(new ByteArrayInputStream(conf.getBytes()), repository);

        Record record = repository.getDefaultTable().recordBuilder().id("record").field(new QName("ns", "int"), new Integer(42)).build();

        assertNull(idxConf.getRecordFilter().getIndexCase("myrecordtable", record));
    }
View Full Code Here

                Lists.newArrayList("vtags='last'"),
                Lists.newArrayList("tables='myrecordtable'"));

        LilyIndexerConf idxConf = LilyIndexerConfBuilder.build(new ByteArrayInputStream(conf.getBytes()), repository);

        Record record = repository.getDefaultTable().recordBuilder().id("record").field(new QName("ns", "int"), new Integer(42)).build();

        assertNotNull(idxConf.getRecordFilter().getIndexCase("notmyrecordtable", record));
    }
View Full Code Here

     */
    @Test
    public void testNamespaceContexts() throws Exception {
        JsonImport.load(table, repository, getClass().getResourceAsStream("nscontexttest.json"));

        Record record1 = table.read(repository.getIdGenerator().fromString("USER.record1"));
        assertEquals("value1", record1.getField(new QName("import1", "f1")));
        assertEquals(new Integer(55), record1.getField(new QName("import2", "f2")));
    }
View Full Code Here

TOP

Related Classes of org.lilyproject.repository.api.Record

Copyright © 2018 www.massapicom. 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.