Skip to content

@NameInDb does not work #338

@chiara-jm

Description

@chiara-jm

Issue Basics

  • ObjectBox version (are using the latest version?): 1.4.0
  • Reproducibility: always

Reproducing the bug

Description

Queries do not find the proper field on db when the field is renamed using @NameInDb

Code

@Entity
public class MyClass {

    @Id
    long id;

    @NameInDb("someField")
    String mSomeField;
}
List<MyClass> result = mBox.query()
                .equal(MyClass_.mSomeField, "some value")
                .build()
                .find();

Logs & stackstraces

Caused by: io.objectbox.exception.DbException: Could not prepare entity field MyClass.someField (Ljava/lang/String;) - does the field exist with the expected type?
                                                                             at io.objectbox.query.Query.nativeFind(Native Method)
                                                                             at io.objectbox.query.Query$3.call(Query.java:227)
                                                                             at io.objectbox.query.Query$3.call(Query.java:224)
                                                                             at io.objectbox.BoxStore.callInReadTx(BoxStore.java:668)
                                                                             at io.objectbox.BoxStore.callInReadTxWithRetry(BoxStore.java:614)
                                                                             at io.objectbox.query.Query.callInReadTx(Query.java:304)
                                                                             at io.objectbox.query.Query.find(Query.java:224)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions