objectbox / objectbox/objectbox-java

Support entity classes that are inner classes

Open
#1,006 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
Placing entity classes annotated with @Entity and @BaseEntity in another class will result in an error when building.

Basic info (please complete the following information):

  • ObjectBox version: 2.9.1
  • Reproducibility: always
  • Device: N/A (compile time error)
  • OS: N/A (Android library)

To Reproduce
Steps to reproduce the behavior:
1. Create the following hierarchy of classes and build

public class Holder {
    @BaseEntity
    public static abstract class Parent {
        @Id
        long boxId;
        private String text;

        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }
    }

    @Entity
    public static class Child extends Parent {
    }
}

Logs, stack traces
Won't provide because this won't help in any way as IDE's build errors will be much clearer when dev-team build it themselves

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

The report names no source files, tests, or entry points. Start by locating the entity annotation and build-processing path for the shown Holder.Parent/Child hierarchy, then verify that building this example succeeds without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
build-system, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.