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: EXPOSED-680 Less & greater infix ops cannot compile with 2 EntityID expressions #2367

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

bog-walk
Copy link
Member

Description

Summary of the change: Add overloads for infix operators that allow comparison between left- and right-side Expression<EntityID<?>>.

Detailed description:

  • Why:

After PR #2277 removed the Comparable restriction from EntityID, the use of an entity's id with certain Exposed functions that originally maintained this restriction required defining a new function (as mentioned in the final point of 0.56.0 breaking changes).

These operators currently only support Expression<EntityID<?>> as either the left- OR right-side operand for comparison against a literal value or an expression that holds a literal value.

It has now been requested that the signature of some comparison infix operators be reassessed to allow usage like Table1.id less Table2.id and similar usage of EntityID expressions on both sides of the operator.

  • How: Add overloads for less(), lessEq(), greater(), and greaterEq().

Type of Change

Please mark the relevant options with an "X":

  • Bug fix

Affected databases:

  • All

Checklist

  • Unit tests are in place
  • The build is green (including the Detekt check)
  • All public methods affected by my PR has up to date API docs
  • Documentation for my change is up to date

Related Issues

EXPOSED-680

@bog-walk bog-walk requested review from e5l and obabichevjb January 22, 2025 05:08
Copy link
Member

@e5l e5l left a comment

Choose a reason for hiding this comment

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

lgtm

…yID expressions

- When EntityID was no longer made comparable, some operators that relied on this implementation
were not adjusted immediately, namely less, lessEq, greater, and greaterEq.
- It has been requested that they allow both left and right side operators to
be of type Expression<EntityID>.
- Add the necessary overloads & adjust tests.
@bog-walk bog-walk force-pushed the bog-walk/add-comparable-entity-infix-ops branch from 71dfed0 to 7831105 Compare January 28, 2025 20:20
@bog-walk bog-walk merged commit f6da63f into main Jan 28, 2025
5 checks passed
@bog-walk bog-walk deleted the bog-walk/add-comparable-entity-infix-ops branch January 28, 2025 21:34
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