objectbox-java: @NameInDb does not work

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)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

Will look into this for the upcoming version. Thanks for reporting.

Fixed, please confirm with V1.4.4