public void addPropertyToMutation(Mutation m, String rowKey, Property property) { Text columnQualifier = getPropertyColumnQualifier(property); ColumnVisibility columnVisibility = visibilityToAccumuloVisibility(property.getVisibility()); Object propertyValue = property.getValue(); if (propertyValue instanceof StreamingPropertyValue) { propertyValue = saveStreamingPropertyValue(rowKey, property, (StreamingPropertyValue) propertyValue); } if (propertyValue instanceof DateOnly) { propertyValue = ((DateOnly) propertyValue).getDate(); } Value value = new Value(valueSerializer.objectToValue(propertyValue)); m.put(AccumuloElement.CF_PROPERTY, columnQualifier, columnVisibility, value); addPropertyMetadataToMutation(m, property); }
.setProperty("text", "hello", VISIBILITY_A) .setProperty("age", 25, VISIBILITY_A) .setProperty("birthDate", new DateOnly(1989, 1, 5), VISIBILITY_A) .setProperty("lastAccessed", createDate(2014, 2, 24, 13, 0, 5), VISIBILITY_A) .save(AUTHORIZATIONS_A_AND_B); .setProperty("text", "world", VISIBILITY_A) .setProperty("age", 30, VISIBILITY_A) .setProperty("birthDate", new DateOnly(1984, 1, 5), VISIBILITY_A) .setProperty("lastAccessed", createDate(2014, 2, 25, 13, 0, 5), VISIBILITY_A) .save(AUTHORIZATIONS_A_AND_B); .has("lastAccessed", Compare.EQUAL, new DateOnly(2014, 2, 24)) .vertices(); assertEquals(1, count(vertices));
propertyValue = ((DateOnly) propertyValue).getDate();
.setProperty("text", "hello", VISIBILITY_A) .setProperty("age", 25, VISIBILITY_A) .setProperty("birthDate", new DateOnly(1989, 1, 5), VISIBILITY_A) .setProperty("lastAccessed", createDate(2014, 2, 24, 13, 0, 5), VISIBILITY_A) .save(AUTHORIZATIONS_A_AND_B); .setProperty("text", "world", VISIBILITY_A) .setProperty("age", 30, VISIBILITY_A) .setProperty("birthDate", new DateOnly(1984, 1, 5), VISIBILITY_A) .setProperty("lastAccessed", createDate(2014, 2, 25, 13, 0, 5), VISIBILITY_A) .save(AUTHORIZATIONS_A_AND_B); .has("lastAccessed", Compare.EQUAL, new DateOnly(2014, 2, 24)) .vertices(); assertEquals(1, count(vertices));
propertyValue = ((DateOnly) propertyValue).getDate();
propertyValue = ((DateOnly) propertyValue).getDate();