title: Is it possible to add many-to-many relationship without initialize collection in NHibernate?
body: <p>Here is my class:</p>
  
  <pre><code>public class User
  {
    public int Id { get; set; }
    public string Name { get; set; }
  
    public ISet&lt;User&gt; Friends { get; set; }
  }
  </code></pre>
  
  <p>Here is my mapping:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
    namespace="Test" assembly="test"&gt;
  
    &lt;class name="User" table="Users"&gt;
        &lt;id name="Id" column="id"&gt;
            &lt;generator class="native"/&gt;
        &lt;/id&gt;
        &lt;property name="Name" column="name"/&gt;
        &lt;set name="Friends" table="Friends"&gt;
            &lt;key column="user_id"/&gt;
            &lt;many-to-many class="User" column="friend_id"/&gt;
        &lt;/set&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Here is the problem:</p>
  
  <pre><code>User user = session.Load&lt;User&gt;(1);
  
  User friend = new User();
  friend.Name = "new friend";
  
  user.Friends.Add(friend);
  </code></pre>
  
  <p>At the last line [user.Friends.Add(friend)], I noticed that it will initialize the Friends collection before add new friend to it.</p>
  
  <p>My question is: Is there anyway to avoid this behavior in NHibernate? Because I just want to have only single INSERT command to be executed for performance reason.</p>