Skip to content

Conversation

@gtchaboussie
Copy link

EntityQuery use dispatcher

Improved: Creates an interface for queryable objects, or objects that have a delegator.
(OFBIZ-13313)

Explanation: Allows the use of the dispatcher directly in the EntityQuery.
Created the Queryable interface to do so.

Thanks: to Jacopo and Nicolas for the feedback.

cgaetan added 2 commits November 24, 2025 13:15
Creates an interface for queryable objects, or objects that have a delegator.
Allows for shorter queries.
Thanks to Jacopo and Nicolas for the feedback.
Fixes the param name in javadoc

enum OperationType { INSERT, UPDATE, DELETE }

Delegator getDelegator();
Copy link
Contributor

Choose a reason for hiding this comment

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

This declaration is not required since it is an inherited method.

import org.apache.ofbiz.entity.Delegator;

/**
* Interface used for the <code>EntityQuery</code> to set the delegator to yse for the query.
Copy link
Contributor

Choose a reason for hiding this comment

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

The Javadoc should just describe the capability of the interface without directly mentioning the classes that may use it (such as EntityQuery). There are also a few typos, such as: "yse", "easyer".

public interface Queryable {

/**
* Gets the GenericEntityDelegator associated with this dispatcher
Copy link
Contributor

Choose a reason for hiding this comment

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

The Javadoc is not correct as it mentions GenericEntityDelegator rather than Delegator and it mentions "this dispatcher" which is out of context in this interface.

@jacopoc
Copy link
Contributor

jacopoc commented Nov 24, 2025

Thanks Gaetan,

The introduction of the new interface makes sense and solves the concern I had.
However in my opinion the name "Queryable" doesn't describe very well the capability of the new interface. A better name could be "DelegatorProvider".
I have also added a few comments inline.

cgaetan added 2 commits November 24, 2025 15:46
Fixes points raised by Jacopo.
Thanks for the review.
Typo
@sonarqubecloud
Copy link

@gtchaboussie
Copy link
Author

Thanks for the review, all issues should have been fixed.
The name of "DelegatorProvider" sounds fine to me, and more descriptive of the intention of the interface.

@jacopoc
Copy link
Contributor

jacopoc commented Nov 24, 2025

Thanks Gaetan, it looks good to me 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.

2 participants