Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix for h-omer#8 #13

Merged
merged 15 commits into from
Mar 10, 2021
Merged

🐛 fix for h-omer#8 #13

merged 15 commits into from
Mar 10, 2021

Conversation

tschn
Copy link

@tschn tschn commented Apr 22, 2020

check to see if relationship end node matches before deleting

@mfalcier
Copy link
Member

Hi! And thanks for your contribution! May I ask you if you could also provide some tests for what you've implemented? Thanks!

@tschn
Copy link
Author

tschn commented May 1, 2020

sure, I will work on those next week, thanks!

@mfalcier
Copy link
Member

mfalcier commented May 1, 2020

Thank you so much!

@tschn
Copy link
Author

tschn commented May 7, 2020

test added, please let me know if you want additional testing

Copy link
Member

@albertodeste albertodeste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good implementation. Still a few changes and I think it can be merged.

if (listA.size() != listB.size()) {
System.out.println("Lists must have same size" + listA);
} else {
for (int index = 0; index < listA.size(); index++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return IntStream.range(0, listaA.size())
.mapToObj(i -> Pair.of(listA.get(i), listB.get(i))
.collect(Collectors.toList());

@@ -222,7 +221,20 @@ public static LocalDateTime convertEpochToLocalDateTime(Long epochDateTime) {
return Instant.ofEpochMilli(epochDateTime).atZone(ZoneId.systemDefault()).toLocalDateTime();
}

public static Boolean isSystemType(String type) {
public static <A, B> List<org.apache.commons.lang3.tuple.Pair<A, B>> zip(List<A> listA, List<B> listB) {
List<Pair<A, B>> pairList = new LinkedList<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove in favor of following comment

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see latest commit

isEntityOrThrowException(entitySource);

return entityDestinations.size() == relProps.size() ? sourceCurrentState.map(node -> zip(entityDestinations, relProps).stream().map((item) -> {
final Node destinationNode = item.getLeft();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to move this inlined function into a more speaking method of the same class?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see latest commit

Optional<Node> sourceCurrentState = createNewSourceState(entitySource, defaultToNow(date));
isEntityOrThrowException(entitySource);

return entityDestinations.size() == relProps.size() ? sourceCurrentState.map(node -> zip(entityDestinations, relProps).stream().map((item) -> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use explicit "if" condition? It is more readable.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see latest commit

@tschn tschn changed the title 🎉 🐛 fix for h-omer#8 🐛 fix for h-omer#8 Oct 20, 2020
@mfalcier
Copy link
Member

Hi @tschn , can you please explain the new procedure you've added for multiple relationship delete?
Can we also add it to the documentation next?

@mfalcier
Copy link
Member

@tschn is there any chance you're going to explain your changes? we would like to integrate those, but it would be nice to hear something from you!

@tschn
Copy link
Author

tschn commented Jan 15, 2021

please see latest commit for updated documentation, the plural procedures were added to allow updating more than one relationship for a given state for 'batch' style updates to the graph

@mfalcier mfalcier merged commit c268139 into h-omer:master Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants