realm-java v4.0.0 Release Notes
Release Date: 2017-10-16 // over 6 years ago-
π₯ Breaking Changes
β¬οΈ The internal file format has been upgraded. Opening an older Realm will upgrade the file automatically, but older versions of Realm will no longer be able to read the file.
- β‘οΈ [ObjectServer] Updated protocol version to 22 which is only compatible with Realm Object Server >= 2.0.0.
- π [ObjectServer] Removed deprecated APIs
SyncUser.retrieveUser()
andSyncUser.retrieveUserAsync()
. UseSyncUser.retrieveInfoForUser()
andretrieveInfoForUserAsync()
instead. - π [ObjectServer]
SyncUser.Callback
now accepts a generic parameter indicating type of object returned whenonSuccess
is called. - π [ObjectServer] Renamed
SyncUser.getAccessToken
toSyncUser.getRefreshToken
. - π [ObjectServer] Removed deprecated API
SyncUser.getManagementRealm()
. - Calling
distinct()
on a sortedRealmResults
no longer clears any sorting defined (#3503). - π Relaxed upper bound of type parameter of
RealmList
,RealmQuery
,RealmResults
,RealmCollection
,OrderedRealmCollection
andOrderedRealmCollectionSnapshot
. - β¬οΈ Realm has upgraded its RxJava1 support to RxJava2 (#3497)
Realm.asObservable()
has been renamed toRealm.asFlowable()
.RealmList.asObservable()
has been renamed toRealmList.asFlowable()
.RealmResults.asObservable()
has been renamed toRealmResults.asFlowable()
.RealmObject.asObservable()
has been renamed toRealmObject.asFlowable()
.RxObservableFactory
now return RxJava2 types instead of RxJava1 types.
- β Removed deprecated APIs
RealmSchema.close()
andRealmObjectSchema.close()
. Those don't have to be called anymore. - β Removed deprecated API
RealmResults.removeChangeListeners()
. UseRealmResults.removeAllChangeListeners()
instead. - β Removed deprecated API
RealmObject.removeChangeListeners()
. UseRealmObject.removeAllChangeListeners()
instead. - π Removed
UNSUPPORTED_TABLE
,UNSUPPORTED_MIXED
andUNSUPPORTED_DATE
fromRealmFieldType
. - β Removed deprecated API
RealmResults.distinct()
/RealmResults.distinctAsync()
. UseRealmQuery.distinct()
/RealmQuery.distinctAsync()
instead. - π
RealmQuery.createQuery(Realm, Class)
,RealmQuery.createDynamicQuery(DynamicRealm, String)
,RealmQuery.createQueryFromResult(RealmResults)
andRealmQuery.createQueryFromList(RealmList)
have been removed. UseRealm.where(Class)
,DynamicRealm.where(String)
,RealmResults.where()
andRealmList.where()
instead.
β¨ Enhancements
- π [ObjectServer]
SyncUserInfo
now also exposes a users metadata usingSyncUserInfo.getMetadata()
- π
RealmList
can now containString
,byte[]
,Boolean
,Long
,Integer
,Short
,Byte
,Double
,Float
andDate
values. Queries and Importing primitive lists from JSON are not supported yet. - β Added support for lists of primitives in
RealmObjectSchema
withaddRealmListField(String fieldName, Class<?> primitiveType)
- β Added support for lists of primitives in
DynamicRealmObject
withsetList(String fieldName, RealmList<?> list)
andgetList(String fieldName, Class<?> primitiveType)
. - π Minor performance improvement when copy/insert objects into Realm.
- β Added
static RealmObject.getRealm(RealmModel)
,RealmObject.getRealm()
andDynamicRealmObject.getDynamicRealm()
(#4720). - β Added
RealmResults.asChangesetObservable()
that emits the pair(results, changeset)
(#4277). - β Added
RealmList.asChangesetObservable()
that emits the pair(list, changeset)
(#4277). - β Added
RealmObject.asChangesetObservable()
that emits the pair(object, changeset)
(#4277). - All Realm annotations are now kept at runtime, allowing runtime tools access to them (#5344).
- Speedup schema initialization when a Realm file is first accessed (#5391).
π Bug Fixes
- [ObjectServer] Exposing a
RealmConfiguration
that allows a user to open the backup Realm after the client reset (#4759/#5223). - π [ObjectServer] Realm no longer throws a native βunsupported instructionβ exception in some cases when opening a synced Realm asynchronously (https://github.com/realm/realm-object-store/issues/502).
- π [ObjectServer] Fixed "Cannot open the read only Realm" issue when get
PermissionManager
(#5414). - Throw
IllegalArgumentException
instead ofIllegalStateException
when calling string/binary data setters if the data length exceeds the limit. - β Added support for ISO8601 2-digit time zone designators (#5309).
- "Bad File Header" caused by the device running out of space while compacting the Realm (#5011).
RealmQuery.equalTo()
failed to find null values on an indexed field if using Case.INSENSITIVE (#5299).- Assigning a managed object's own list to itself would accidentally clear it (#5395).
- Don't try to acquire
ApplicationContext
if not available inRealm.init(Context)
(#5389). - Removing and re-adding a changelistener from inside a changelistener sometimes caused notifications to be missed (#5411).
Internal
- β¬οΈ Upgraded to Realm Sync 2.0.2.
- β¬οΈ Upgraded to Realm Core 4.0.2.
- β¬οΈ Upgraded to OkHttp 3.9.0.
- β¬οΈ Upgraded to RxJava 2.1.4.
- π Use Object Store to create the primary key table.
Credits
- π Thanks to @JussiPekonen for adding support for 2-digit time zone designators when importing JSON (#5309).