anchor.diff:      exec_driver(ModelName, ?PERSISTENCE_DRIVER, add_links, [Key, normalize_link_target(Links)]).
   
   
  +%%--------------------------------------------------------------------
  +%% @doc
  +%% Removes links from given document. There is special link name 'all' which removes all links.
  +%%--------------------------------------------------------------------
   -spec delete_links(document(), link_name() | [link_name()] | all) -> ok | generic_error().
   delete_links(#document{key = Key} = Doc, LinkNames) ->
       delete_links(Key, model_name(Doc), LinkNames).
   
  +
  +%%--------------------------------------------------------------------
  +%% @doc
  +%% Removes links from the document with given key. There is special link name 'all' which removes all links.
  +%%--------------------------------------------------------------------
   -spec delete_links(key(), model_behaviour:model_type(), link_name() | [link_name()] | all) -> ok | generic_error().
   delete_links(Key, ModelName, LinkNames) when is_list(LinkNames); LinkNames =:= all ->
       _ModelConfig = ModelName:model_init(),
  
positive.code: -type update_error() :: not_found_error(term()) | generic_error().
  -type create_error() :: generic_error() | {error, already_exists}.
  -type get_error() :: not_found_error(term()) | generic_error().
  
  -export_type([generic_error/0, not_found_error/1, update_error/0, create_error/0, get_error/0]).
  
  %% API utility types
  -type store_level() :: disk_only | local_only | global_only | locally_cached | globally_cached.
  
negative.code:     end.
  
  
  %%--------------------------------------------------------------------
  %% @doc
  %% Executes given function for each link of given document - similar to 'foldl'.
  %%--------------------------------------------------------------------
  -spec foreach_link(document(), fun((link_name(), link_target(), Acc :: term()) -> Acc :: term()), AccIn :: term()) ->
      {ok, Acc :: term()} | link_error().
  foreach_link(#document{key = Key} = Doc, Fun, AccIn) ->
      foreach_link(Key, model_name(Doc), Fun, AccIn).
  
  
  %%--------------------------------------------------------------------
  %% @doc
  %% Executes given function for each link of the document given by key - similar to 'foldl'.
  %%--------------------------------------------------------------------
  -spec foreach_link(Key :: key(), ModelName :: model_behaviour:model_type(),
      fun((link_name(), link_target(), Acc :: term()) -> Acc :: term()), AccIn :: term()) ->
      {ok, Acc :: term()} | link_error().
  foreach_link(Key, ModelName, Fun, AccIn) ->
      exec_driver(ModelName, ?PERSISTENCE_DRIVER, foreach_link, [Key, Fun, AccIn]).
  
  
  %%--------------------------------------------------------------------
  %% @doc
  %% "Walks" from link to link and fetches either all encountered documents (for Mode == get_all - not yet implemted),
  %% or just last document (for Mode == get_leaf). Starts on given document.
  %%--------------------------------------------------------------------
  -spec link_walk(document(), [link_name()], get_leaf | get_all) ->
      {ok, document() | [document()]} | link_error() | get_error().
  link_walk(#document{key = StartKey} = StartDoc, LinkNames, Mode) when is_atom(Mode), is_list(LinkNames) ->
      link_walk(StartKey, model_name(StartDoc), LinkNames, Mode).
  
  
  %%--------------------------------------------------------------------
  %% @doc
  %% "Walks" from link to link and fetches either all encountered documents (for Mode == get_all - not yet implemted),
  %% or just last document (for Mode == get_leaf). Starts on the document given by key.
  %%--------------------------------------------------------------------
  -spec link_walk(Key :: key(), ModelName :: model_behaviour:model_type(), [link_name()], get_leaf | get_all) ->
      {ok, document() | [document()]} | link_error() | get_error().
  link_walk(_Key, _ModelName, _Links, get_all) ->
      erlang:error(not_inplemented);
  link_walk(Key, ModelName, [LastLink], get_leaf) ->
      case fetch_link_target(Key, ModelName, LastLink) of
          {ok, #document{} = Leaf} ->
  