Skip to content

DATAGRAPH-1428 - Implement deleteAllById(Iterable<ID> ids). #554

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

Closed
wants to merge 4 commits into from

Conversation

schauder
Copy link
Contributor

Merge right after DATACMNS-800

Copy link
Collaborator

@michael-simons michael-simons left a comment

Choose a reason for hiding this comment

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

Thanks for adding this from VMWare's side, much appreciate it.

Please be so kind and remove the unrelated chances and have a look at the imperative test. While the reactive makes complete sense, I don't understand the unused additional person instance.

Thanks.

import org.springframework.data.neo4j.integration.shared.common.ThingWithAssignedId;
import org.springframework.data.neo4j.integration.shared.common.ThingWithGeneratedId;
import org.springframework.data.neo4j.integration.shared.common.WorksInClubRelationship;
import org.springframework.data.neo4j.integration.shared.common.*;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we keep the explicit imports, please?

Copy link
Member

Choose a reason for hiding this comment

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

Is there an import style config that we can configure on our side when touching Spring Data Neo4j? In other Spring Data modules, we apply https://github.com/spring-projects/spring-data-build/tree/master/etc/ide#intellij-setup.

import java.util.stream.IntStream;
import java.util.stream.StreamSupport;

import static org.assertj.core.api.Assertions.*;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the order change?

@@ -524,7 +492,8 @@ void findBySimplePropertiesAnded(@Autowired PersonRepository repository) {
assertThat(optionalPerson).isPresent().contains(person1);
}

@Test // GH-112
@Test
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please undo.

@@ -550,7 +519,8 @@ void findBySimplePropertiesOred(@Autowired PersonRepository repository) {
assertThat(persons).containsExactlyInAnyOrder(person1, person2);
}

@Test // DATAGRAPH-1374
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please undo.

@@ -562,7 +532,8 @@ void findSliceShouldWork(@Autowired PersonRepository repository) {
assertThat(slice.hasNext()).isFalse();
}

@Test // DATAGRAPH-1412
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please undo.

@@ -2610,7 +2598,8 @@ void count(@Autowired PersonRepository repository) {
assertThat(repository.count()).isEqualTo(2);
}

@Test // GH-112
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please undo.

interface SimilarThingRepository extends Neo4jRepository<SimilarThing, Long> {}
interface SimilarThingRepository extends Neo4jRepository<SimilarThing, Long> {
}

interface BaseClassRepository extends Neo4jRepository<Inheritance.BaseClass, Long> {}
interface BaseClassRepository extends Neo4jRepository<Inheritance.BaseClass, Long> {
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please undo.

Comment on lines 3237 to 3240
interface BaseClassWithLabelsRepository extends Neo4jRepository<Inheritance.BaseClassWithLabels, Long> {}
interface BaseClassWithLabelsRepository extends Neo4jRepository<Inheritance.BaseClassWithLabels, Long> {
}

interface EntityWithConvertedIdRepository
extends Neo4jRepository<EntityWithConvertedId, EntityWithConvertedId.IdentifyingEnum> {}
extends Neo4jRepository<EntityWithConvertedId, EntityWithConvertedId.IdentifyingEnum> {
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please undo.

Comment on lines 3248 to 3249
interface FriendRepository extends Neo4jRepository<Friend, Long> {}
interface FriendRepository extends Neo4jRepository<Friend, Long> {
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please undo.

Comment on lines 3282 to 3286
@Autowired private Driver driver;
@Autowired
private Driver driver;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please undo.

import org.springframework.data.neo4j.integration.shared.common.ThingWithAssignedId;
import org.springframework.data.neo4j.integration.shared.common.ThingWithGeneratedId;
import org.springframework.data.neo4j.integration.shared.common.WorksInClubRelationship;
import org.springframework.data.neo4j.integration.shared.common.*;
Copy link
Member

Choose a reason for hiding this comment

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

Is there an import style config that we can configure on our side when touching Spring Data Neo4j? In other Spring Data modules, we apply https://github.com/spring-projects/spring-data-build/tree/master/etc/ide#intellij-setup.

@@ -3151,18 +3140,24 @@ void shouldFindExtendedNodeViaExtendedAttribute(@Autowired ParentRepository repo
}
}

interface BidirectionalStartRepository extends Neo4jRepository<BidirectionalStart, Long> {}
interface BidirectionalStartRepository extends Neo4jRepository<BidirectionalStart, Long> {
Copy link
Member

Choose a reason for hiding this comment

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

Our formatter config is at https://github.com/spring-projects/spring-data-build/blob/master/etc/ide/eclipse-formatting.xml. Let me know whether the formatting changes here stem from our config so we can fix that on our side.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought we had this applied. My bad if that isn't the case.

Regarding the star imports: Isn't the common agreement that they should be avoided? At least that was my impression when I did this: 7804bdc

Copy link
Member

Choose a reason for hiding this comment

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

I think your code is fine, I assume some IDE settings or an outdated config on our side.

RE star imports: Each Spring project has its own approach to code style. Following the Boot style is fine, it would be good to document that somewhere as the Spring Data import style looks different.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I am a bit surprised that Jenkins is happy… I just tracked the branch and a mvn checkstyle:check@validate fails as expected. Checkstyle runs in verify phase, after all tracks (as we discussed a while back in d824e5d).

Copy link
Member

Choose a reason for hiding this comment

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

Actually, the associated Job fails (https://jenkins.spring.io/view/SpringData/job/spring-data-neo4j/job/issue%252FDATAGRAPH-1428/4/). It's green because we suppress upstream trigger causes. For some reason, the suppression still creates a no-op job that appears to be green.

Copy link
Contributor Author

@schauder schauder Nov 24, 2020

Choose a reason for hiding this comment

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

I didn't have the proper code formatting applied. I fixed that but still have some changes left. I'll undo them manually.

The points where the formatting of Neo4J differs from Spring Data seems to be:

  • Spring Data Formatting prescribes star imports for static imports and for 10 or more imports.
  • The import order seams to be subtly different, the ordering of subpackages is different.

michael-simons and others added 3 commits November 24, 2020 14:36
…gerTest, too.

This allows for development against changes in commons which aren't on master yet.
The additional person allows to actually delete multiple persons, without deleting all of them.
@schauder schauder force-pushed the issue/DATAGRAPH-1428 branch from 19e4089 to d7aef08 Compare November 24, 2020 14:09
@schauder
Copy link
Contributor Author

have a look at the imperative test. While the reactive makes complete sense, I don't understand the unused additional person instance.

The third person now gets saved, allowing us to delete more than one person without deleting all.

mp911de pushed a commit that referenced this pull request Nov 25, 2020
…deleteAllById(Iterable<ID> ids).

Original pull request: #554.
mp911de pushed a commit that referenced this pull request Nov 25, 2020
…gerTest, too.

This allows for development against changes in commons which aren't on master yet.

Original pull request: #554.
mp911de added a commit that referenced this pull request Nov 25, 2020
Reorder methods. Fix import ordering.

Original pull request: #554.
@mp911de
Copy link
Member

mp911de commented Nov 25, 2020

That's merged and polished now.

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.

3 participants