find method
Fast lookup for a RealmObject
of type className
with the specified primaryKey
.
Implementation
RealmObject? find(String className, Object primaryKey) {
final metadata = _realm._metadata.getByName(className);
final handle = realmCore.find(_realm, metadata.classKey, primaryKey);
if (handle == null) {
return null;
}
final accessor = RealmCoreAccessor(metadata, _realm._isInMigration);
return RealmObjectInternal.create(RealmObject, _realm, handle, accessor) as RealmObject;
}