long
. You are free to use the wrapper type java.lang.Long
, but we advise against it in most cases. long
IDs are enforced to make ObjectBox very efficient internally.put()
.long
value, with two exceptions:null
if the ID is of type Long
) are considered new (not persisted before). Putting such an object will always insert a new object and assign an unused ID to it.