Package org.lilyproject.repository.api

Examples of org.lilyproject.repository.api.RecordBuilder


        matchResultCounts.put(indexField + ":gamma_" + indexField + "_updated", counts[6]);
        matchResultCounts.put(indexField + ":delta_" + indexField + "_updated", counts[7]);
    }

    private void createMatchTestRecord(String ns, String name, String id) throws Exception {
        RecordBuilder builder = defaultTable.recordBuilder();

        builder.recordType(new QName(ns, name))
                .id(id);

        for (int i = 1; i <= 4; i++) {
            builder.field(new QName(NS2, "match" + i), id + "_" + "match" + i + "_orig");
            builder.field(new QName(NS, "nvmatch" + i), id + "_" + "nvmatch" + i + "_orig");
        }
        builder.field(previewTag.getName(), new Long(1));

        builder.create();
    }
View Full Code Here


        assertEquals(record2.getId(), link.getMasterRecordId());
    }

    @Test
    public void testRecordBuilder() throws Exception {
        RecordBuilder builder = repository.recordBuilder();
        Record record = builder.recordType(recordType1.getName())
                .field(fieldType1.getName(), "abc")
                .field(fieldType2.getName(), 123)
                .field(fieldType3.getName(), true)
                .create();
        assertEquals(record, repository.read(record.getId()));

        builder.reset();
        Record record2 = builder.recordType(recordType2.getName())
                .field(fieldType4.getName(), 999)
                .field(fieldType5.getName(), true)
                .field(fieldType6.getName(), "xyz")
                .create();
View Full Code Here

        }
    }

    @Test
    public void testDefaultNamespace() throws Exception {
        RecordBuilder builder = repository.recordBuilder();
        Record record = builder.defaultNamespace(namespace)
                .recordType("RT1")
                .field("field1", "abc")
                .field("field2", 123)
                .field("field3", true)
                .create();
View Full Code Here

        runJson();
        runRvt();
    }

    private Record buildRvtRecord(String ns, int nrOfFields) throws Exception {
        RecordBuilder rvtRecordBuilder = repository.recordBuilder().defaultNamespace(ns);
        for (int i = 0; i < nrOfFields; i++) {
            rvtRecordBuilder.field("stringField"+i, "value"+i);
        }
        return repository.recordBuilder().defaultNamespace(ns).recordType("rvtFieldRT").field("rvtField", rvtRecordBuilder.build()).build();
    }
View Full Code Here

TOP

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

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.