David
--
To unsubscribe, reply using "remove me" as the subject.
####
BasicDBObject options=new BasicDBObject().append("background",
true);
BasicDBObject q=new BasicDBObject();
q.put("datum_zadani", 1);
taskDAO.collection().ensureIndex(q,options);
####
One additional question, can I define database name somewhere in more
global way than in DAO constructor? In very common cases, when one
application means one mongo database, I have to repeat it again and
again. But I certainly miss something here.
David
On 8 dub, 15:42, Mauricio Garavaglia <mauriciogaravag...@gmail.com>
wrote:
But I will look into this and add better indexing support to the DAO.
Regarding the Database name, if you are extending the DAO then you can
just create a constant in a class somewhere and reference it. However,
if you are using the DAO directly, then I can understand that this
becomes repetetive.
I am going to look into adding the database name to the entity
annotation. That way we could by default retrieve both the name of the
database and the collection from the @Entity annotation (or something
similar), which is defined in a single place.
Thanks for the feedback.
Regards,
OGG
Hi David,
So far I've solved this by creating an ensureIndexes() method in MyDAO
(extends DAO<T,K>), which is a @Singleton created and managed by
Google Guice.
But I will look into this and add better indexing support to the DAO.
Regarding the Database name, if you are extending the DAO then you can
just create a constant in a class somewhere and reference it. However,
if you are using the DAO directly, then I can understand that this
becomes repetetive.
I am going to look into adding the database name to the entity
annotation. That way we could by default retrieve both the name of the
database and the collection from the @Entity annotation (or something
similar), which is defined in a single place.