Can the morphia single BasicDAO handle/query multiple collection, may by be by overloading function with the class parameter.
public class GenericDAO extends BasicDAO<T, K> {
/* override count impl*/
public long count(Class<T> clazz) {
return ds.getCount(clazz);
}
}
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.
Example For User and BlogEntry Collections
public class BlogEntryDAO extends BasicDAO<BlogEntry, ObjectId>
public class UserDAO extends BasicDAO<User, ObjectId>