title: Morphia Single dao for multiple collection MongoDB
body: <p>Can the morphia single BasicDAO handle/query multiple collection, may by be by overloading function with the class parameter.</p>
  
  <pre><code>public class GenericDAO extends BasicDAO&lt;T, K&gt; {
  
    /* override count impl*/
    public long count(Class&lt;T&gt; clazz) {
       return ds.getCount(clazz);
    }
  }
  </code></pre>
  
  <p>Is there any other way I can query two different collection using single DOA or it is better to make separate DAO for each collection.</p>
  
  <p>Example For User and BlogEntry Collections</p>
  
  <pre><code>public class BlogEntryDAO extends BasicDAO&lt;BlogEntry, ObjectId&gt;
  public class UserDAO extends BasicDAO&lt;User, ObjectId&gt;
  </code></pre>