Package org.lilyproject.repository.api

Examples of org.lilyproject.repository.api.HierarchyPath


    }

    private void runValueTypeTests(String name, String valueType, Object value1, Object value2, Object value3) throws Exception {
        testType(name, valueType, value1);
        testType(name, "LIST<"+valueType+">", Arrays.asList(value1, value2));
        testType(name, "PATH<"+valueType+">", new HierarchyPath(value1, value2));
        testType(name, "LIST<PATH<"+valueType+">>", Arrays.asList(new HierarchyPath(value1, value2), new HierarchyPath(value1, value3)));
    }
View Full Code Here


        int nrOfValues = dataInput.readInt();
        List<Object> result = new ArrayList<Object>(nrOfValues);
        for (int i = 0 ; i < nrOfValues; i++) {
            result.add(valueType.read(dataInput));
        }
        return new HierarchyPath(result.toArray(new Object[result.size()]));
    }
View Full Code Here

            verifyResultCount("v_blob:\"Sed pretium pretium lorem\"", 1);
            verifyResultCount("v_blob:lily", 0);

            // Multi-value and hierarchical blob field
            log.debug("Begin test V71");
            HierarchyPath path1 = new HierarchyPath(blob1dup, blob2);
            HierarchyPath path2 = new HierarchyPath(blob3, blob4);
            List<HierarchyPath> blobs = Arrays.asList(path1, path2);

            Record record2 = defaultTable.newRecord();
            record2.setRecordType(vRecordType1.getName());
            record2.setField(vBlobMvHierField.getName(), blobs);
View Full Code Here

            // type match fields
            record.setField(field8.getName(), new LocalDate(2011, 4, 11));
            // multi-value match fields
            record.setField(field9.getName(), Arrays.asList("decagon", "dodecahedron"));
            // hierarchical match fields
            record.setField(field10.getName(), new HierarchyPath("triangle", "knot"));

            expectEvent(CREATE, Table.RECORD.name, record.getId(), 1L, null, field1.getId(), field2.getId(), field3.getId(),
                    field4.getId(), field5.getId(), field6.getId(), field7.getId(), field8.getId(), field9.getId(),
                    field10.getId());
            record = defaultTable.create(record);
View Full Code Here

                    .defaultNamespace("ns")
                    .recordType("MyRecordType")
                    .field("nestedLinks",
                            Arrays.asList(
                                    Arrays.asList(
                                            new HierarchyPath(new Link(ids.newRecordId("nl1"))),
                                            new HierarchyPath(new Link(ids.newRecordId("nl2")))
                                    ),
                                    Arrays.asList(
                                            new HierarchyPath(new Link(ids.newRecordId("nl3"))),
                                            new HierarchyPath(new Link(ids.newRecordId("nl4")))
                                    )
                            ))
                    .create();
            repoSetup.waitForSepProcessing();
View Full Code Here

      Link linkValue = new Link(idGenerator.newRecordId());
      Blob blobValue = new Blob(Bytes.toBytes("anotherKey"), "image/jpeg", Long.MIN_VALUE, "images/image.jpg");
      URI uriValue = URI.create("http://foo.com/bar");
      List<String> listValue = new ArrayList<String>();
      listValue.add("abc");
      HierarchyPath pathValue = new HierarchyPath("abc");
      Record recordValue = repository.recordBuilder().field(stringFieldName, "foo").build();

      Record record = repository.recordBuilder()
          .field(stringFieldName, stringValue)
          .field(integerFieldName, integerValue)
          .field(longFieldName, longValue)
          .field(doubleFieldName, doubleValue)
          .field(decimalFieldName, decimalValue)
          .field(booleanFieldName, booleanValue)
          .field(dateFieldName, dateValue)
          .field(dateTimeFieldName, dateTimeValue)
          .field(linkFieldName, linkValue)
          .field(blobFieldName, blobValue)
          .field(uriFieldName, uriValue)
          .field(listFieldName, listValue)
          .field(pathFieldName, pathValue)
          .field(recordFieldName, recordValue)
          .build();

      // Clone record
        record = record.cloneRecord();

      // Change mutable values
      listValue.add("def");
      pathValue.getElements()[0] = "def";
      blobValue.setSize(0L);
      recordValue.setField(integerFieldName, 777);

      // Validate cloned record does not contain mutations
      List<String> list = record.getField(listFieldName);
      assertTrue(list.size() == 1);
      assertEquals("abc", list.get(0));

      HierarchyPath path = record.getField(pathFieldName);
      assertEquals("abc", path.getElements()[0]);

      Blob blob = record.getField(blobFieldName);
      assertTrue(Long.MIN_VALUE == blob.getSize());

      Record recordField = record.getField(recordFieldName);
View Full Code Here

TOP

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

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.