Hi,
Today I was reading about different NoSQL databases. One of those database - MongoDB - has a very nice feature, especially for web applications - modifier operations.
The whole trick for those operations is to change some value in object without pulling this object from database. So for example we have class:
public class WebVisit { public String url; // key public int visitsCount; }
As for now I have to pull this class from database:
WebVisit visit = em.find(WebVisit.class, url);
and increment counter:
visit.visitsCount++;
So, what I propose is a method that will take class and field name and increment value in this field:
em.incValue(WebVisit.class, "visitsCount");
The same for decValue(). Maybe some method for adding element to the list:
em.addList(ClassWithList.class, "field_list", value);
What do you guys think about it?