objectbox / objectbox/objectbox-java

Enforce type on queries

Open
#70 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
4.6k
Forks
311
PR merge metrics
No merged PRs in 30d

Description

If:

  • Entity_ would be a a generic type like Entity_<Entity>
  • each property would also be a generic type like Property<Entity>
  • the QueryBuilder#equal method (and others) would take Property<Entity> as arguments

then the IDE would warn in case of the following statement:

boxForA.query().equal(propertyForB, 42L).build()

(mixing a property of entity B against the box for A)

What do you think?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Entity_, Property, and QueryBuilder#equal types mentioned in the proposal, along with the surrounding query API. Determine whether entity-property mismatches can be rejected by the IDE without breaking existing usage; the issue is done when the intended type enforcement and its compatibility impact are defined and validated.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.