Skip to content

OFBIZ-13313#923

Merged
gtchaboussie merged 5 commits intoapache:trunkfrom
gtchaboussie:OFBIZ-13313
Feb 18, 2026
Merged

OFBIZ-13313#923
gtchaboussie merged 5 commits intoapache:trunkfrom
gtchaboussie:OFBIZ-13313

Conversation

@gtchaboussie
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

@gtchaboussie
Copy link
Copy Markdown
Contributor 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
Copy Markdown
Contributor

jacopoc commented Nov 24, 2025

Thanks Gaetan, it looks good to me now.

Copy link
Copy Markdown
Contributor

@nmalin nmalin left a comment

Choose a reason for hiding this comment

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

Hello Gaëtan,

I added some improvement on the following patch.

  • Add Licence Apache 2.0 on header for DelegatorProvider
  • GenericEntity implements DelegatorProvider
  • Add test on EntityQuery to be sure that the DelegatorProvider and EntityQuery.use(DelegatorFactory) work well

Thanks for your work !

OFBiz-PR923.patch

@gtchaboussie gtchaboussie requested a review from nmalin January 27, 2026 09:42
…FBIZ-13313)

- Creates an interface for queryable objects, or objects that have a delegator.
- Allows for shorter queries.
Thanks to Jacopo and Nicolas for the feedback and review
@sonarqubecloud
Copy link
Copy Markdown

@gtchaboussie gtchaboussie merged commit 5ec0e99 into apache:trunk Feb 18, 2026
7 checks passed
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