Skip to content

Conversation

@meistermeier
Copy link
Collaborator

Also use the PropertyPathWrapper, that was only used for PartTree / derived queries, now for the relationship pattern creation of the find-by-example mechanism.

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.

Just a small nitpicking, very valuable change, nice test.

String propertyName = graphProperty.getPropertyName();
// Right now we are only accepting the first element of a collection as a filter entry.
// Maybe combining multiple entities with AND might make sense.
if (relationshipObject instanceof Collection) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (relationshipObject instanceof Collection) {
if (relationshipObject instanceof Collection collection) {

// Right now we are only accepting the first element of a collection as a filter entry.
// Maybe combining multiple entities with AND might make sense.
if (relationshipObject instanceof Collection) {
int collectionSize = ((Collection<?>) relationshipObject).size();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
int collectionSize = ((Collection<?>) relationshipObject).size();
int collectionSize = collection.size();

It's possible now to also define fields in the relationships
to query for by example.
This commit advances the functionality of the PropertyPathWrapper class
to also cater for the needs of the Predicate created by the example
instance(s).

Closes #2696
@meistermeier meistermeier deleted the issue/gh2696 branch March 22, 2023 13:27
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