def METHOD_NAME(self, name: str, entry_id: str, loader: t.Callable[[], Model]) -> Model:
    """Returns an existing cached model definition or loads and caches a new one.
    Args:
        name: The name of the entry.
        entry_id: The unique entry identifier. Used for cache invalidation.
        loader: Used to load a new model definition when no cached instance was found.
    Returns:
        The model definition.
    """
    cache_entry = self._file_cache.get(name, entry_id)
    if cache_entry:
        model = cache_entry.model
        if cache_entry.rendered_query is not None:
            model._query_renderer.update_cache(cache_entry.rendered_query, optimized=False)
        return model
    loaded_model = loader()
    if isinstance(loaded_model, SqlModel):
        new_entry = SqlModelCacheEntry(
            model=loaded_model, rendered_query=loaded_model.render_query(optimize=False)
        )
        self._file_cache.put(name, entry_id, new_entry)
    return loaded_model