Skip to content

Adding non-null Kotlin property causes crash when getting existing entity #589

Description

@LeeKingHung

Edit: The original issue described below about default values has moved to #157.

This issue is now about correctly detecting not-nullable properties of Kotlin data classes.

Issue Basics

  • ObjectBox version (are using the latest version?): 2.2

I added a new int (not Integer) property into an existing entity. And I found that the new property values for existing record are all null instead of default value (0 in this case), and the the equal query will always return empty result.

box.query().equal( intProperty, 0) -> zero result
box.query().notEqual( intProperty, 0) -> zero result
box.query().isNull( intProperty ) -> non-empty result

Is this considered a bug? Or I should expect null for primitive property

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions