AllDocumentsRepositoryGetObjectByKey Method (ObjectTransaction, Guid) |
Namespace: Aloe.EnterpriseOne.Model.General
The repository specific key might be different from the primary object Id. For the most derived (terminal) repository types, it is usually the same. But for base classes, the repository specific key is usually different. It identifies the object among all objects from the base repository.
In contrast to GetObjectsByKeys(ObjectTransaction, IEnumerableGuid, Boolean), this method tries to load the object as lazy as possible. If possible, the object is initialized as empty, non-loaded entity object, knowing only its id. The object is capable of comparing for equality with other entity objects without loading its contents. Also, accessing the Id does not load the object. The contents are loaded only when any other property is accessed.
Base classes implement this method by calling GetObjectsByKeys(ObjectTransaction, IEnumerableGuid, Boolean), which loads eagerly the object. Terminal classes usually use the default implementation, which calls GetObjectByPrimaryKey(ObjectTransaction, Guid) to lazy load the object.