Optionalmetadata: MetadataGet by direct key (existing behaviour).
Check if a key exists.
O(1) lookup by entity name + field/value pairs.
Returns the primary key value if a matching entity is in the batch context,
or undefined if not found.
Add an entity to the context (called after save).
Remove all entries and free memory.