public Object beanToEntity(@NotNull PropertyContainer entity, @NotNull Object bean) { Object value = readBeanValue(bean); if (converter != null && value != null) { value = converter.toNeo4j(value); } boolean updateIndex = false; Object oldValue = null; if (indexMapping != null) { oldValue = entity.getProperty(propertyName, null); updateIndex = !Neo4jUtils.equals(oldValue, value); } if (value != null) { entity.setProperty(propertyName, value); } else { entity.removeProperty(propertyName); } if (updateIndex) { indexMapping.update(entity, oldValue, value); } return value; }
public Neo4jDatabase(final String neo4jFolder, boolean readOnly) throws Exception { graphDb = readOnly ? Neo4jUtils.getReadOnlyGraphDb(neo4jFolder) : Neo4jUtils.getGraphDb(neo4jFolder); }
public Neo4jDatabase(final String neo4jFolder) throws Exception { graphDb = Neo4jUtils.getGraphDb(neo4jFolder); }