title: Java generics - Class<?> constructor argument issue
body: <p>I've used Java for quite some time now, but some things are still not very clear to me, especially when it comes to generics...  </p>
  
  <p>Here's the thing: I have this <code>Search</code> class that I'm using (<a href="https://code.google.com/p/hibernate-generic-dao/wiki/Search" rel="nofollow noreferrer">see here for details</a>), that is constructed like this:  </p>
  
  <pre><code>public Search(Class&lt;?&gt; searchClass) {...}
  </code></pre>
  
  <p>Further more, I have a parametrized generic wrapper around this, as follows:  </p>
  
  <pre><code>public class HibernateSearch&lt;E&gt; extends Search implements Serializable {
      public HibernateSearch(Class&lt;E&gt; entityClass) {
          super(entityClass);
      }
      // ... omitted for brevity
  }
  </code></pre>
  
  <p>Now, what I need is the following: I'd like to create parametrized class, that contains this class as its field, e.g.</p>
  
  <pre><code>public class BaseSelectorComposer&lt;T&gt; extends SelectorComposer&lt;Window&gt; {
  
      private HibernateSearch&lt;T&gt; searchObject;
      ...
      @Override
      public void doAfterCompose(Window comp) throws Exception {
          super.doAfterCompose(comp);
          this.searchObject =
               new HibernateSearchObject&lt;T&gt;( now what...??? );
          ...
      }
      ...
  }
  </code></pre>
  
  <p>I think that the problem I'm facing is obvious from the given example.<br>
  Can someone advise what can be done here, or some alternative ?</p>