Realm v3.0.0 Release Notes
Release Date: 2017-02-28 // about 7 years ago-
๐ฅ Breaking Changes
RealmResults.distinct()
returns a newRealmResults
object instead of filtering on the original object (#2947).- โก๏ธ
RealmResults
is auto-updated continuously. Any transaction on the current thread which may have an impact on the order or elements of theRealmResults
will change theRealmResults
immediately instead of change it in the next event loop. The standardRealmResults.iterator()
will continue to work as normal, which means that you can still delete or modify elements without impacting the iterator. The same is not true for simple for-loops. In some cases a simple for-loop will not work (https://realm.io/docs/java/3.0.0/api/io/realm/OrderedRealmCollection.html#loops), and you must use the new createSnapshot() method. RealmChangeListener
onRealmObject
will now also be triggered when the object is deleted. UseRealmObject.isValid()
to check this state(#3138).RealmObject.asObservable()
will now emit the object when it is deleted. UseRealmObject.isValid()
to check this state (#3138).- โ Removed deprecated classes
Logger
andAndroidLogger
(#4050).
๐ Deprecated
- ๐
RealmResults.removeChangeListeners()
. UseRealmResults.removeAllChangeListeners()
instead. - ๐
RealmObject.removeChangeListeners()
. UseRealmObject.removeAllChangeListeners()
instead. RealmResults.distinct()
andRealmResults.distinctAsync()
. UseRealmQuery.distinct()
andRealmQuery.distinctAsync()
instead.
โจ Enhancements
- โ Added support for sorting by link's field (#672).
- โ Added
OrderedRealmCollectionSnapshot
class andOrderedRealmCollection.createSnapshot()
method.OrderedRealmCollectionSnapshot
is useful when changingRealmResults
orRealmList
in simple loops. - โ Added
OrderedRealmCollectionChangeListener
interface for supporting fine-grained collection notifications. - โ Added support for ChangeListeners on
RealmList
. - โ Added
RealmList.asObservable()
.
๐ Bug Fixes
- Element type checking in
DynamicRealmObject#setList()
(#4252). - Now throws
IllegalStateException
instead of process crash when any of thread confined methods inRealmQuery
is called from wrong thread (#4228). - Now throws
IllegalStateException
when any of thread confined methods inDynamicRealmObject
is called from wrong thread (#4258).
Internal
- ๐ Use Object Store's
Results
as the backend forRealmResults
(#3372).- Use Object Store's notification mechanism to trigger listeners.
- Local commits triggers Realm global listener and
RealmObject
listener on current thread immediately instead of in the next event loop.