google-code-export / morphia

Automatically exported from code.google.com/p/morphia
1 stars 0 forks source link

Problem with new changes in 0.99: delete method return WriteResult #218

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
REF: morphia 0.99, mongo-2.4 driver, db version 1.6.3

I have problem with this new change on Release 0.99.

In general delete method of DAO return void.  I have generic DAO which define 
the methods for operations to different dbs (including MongoDB).  But this 
changes would break the generic DAO.  WriteResult is specific to Mongodb and it 
don't have any meaning with other dbs.

What we have is something like this:

public interface GenericDAO<T> {
   // all operations......
   void delete(T entity);
}

public inteface MyEntityDAO extends GenericDAO<MyEntity> {
  // some specific methods for MyEntityDAO
}

public class MyEntityMongodbDAO extends BasicDAO<MyEntity, ObjectId> implements 
MyEntityDAO {
 // this won't work no more because delete method conflict with its return method
}

Original issue reported on code.google.com by Bonnie.S...@gmail.com on 27 Jan 2011 at 8:10

GoogleCodeExporter commented 9 years ago
Yep, but you can wrap instead of inherit if you want.

We are going to have some deps on the driver; that is hard to get away from.

I can leave this open if you want to collect votes but I'm leaning towards not 
changing it.

Original comment by scotthernandez on 27 Jan 2011 at 8:15