title: NHibernate: Finding out if a property is mapped to a field
body: <p>Is there any way to find out if a property is mapped to a field.
  I would like this to generate something like a "generic like search":</p>
  
  <pre><code>    string[] words.
      words = search.Split(' ');
      Type type = typeof(T);
  
      Disjunction disjunction = new Disjunction();
      foreach (System.Reflection.PropertyInfo property in type.GetProperties())
      {
          if ((property.PropertyType == typeof(string)))
          {
  
              foreach (string word in words)
              {
                  disjunction.Add(
                      Expression.InsensitiveLike(
                          property.Name,
                          "%" + word + "%"));
              }
          }
      }
  </code></pre>
  
  <p>If I add a property which is not mapped to NHibernate the search throws an NHibernate.QueryException with the description of "could not resolve property: Text1 of: C"</p>
  
  <p>I am mapping the properties like this:</p>
  
  <pre><code>class C
  {    
      [Property(0, Column = "comment")]
      public virtual string Comment {get; set;}
  }
  </code></pre>