helun/Ektorp — Issue #51: @Generated not working as expected
Author: soltree
Created: 2011-10-18 10:48:17+00:00
State: open

Hi, it seems we have come across some inconsistent functionality when using ektorp 1.2.1 with different versions of couchdb. See below for description.

What steps will reproduce the problem?
1. Create Domain Object
2. fetch it from DB and update
3. Fetch again

What is the expected output? What do you see instead?
Expected = new (updated) values; actual = inital values

What version of the product are you using? On what operating system?
Ektorp 1.2.1 on Win XP SP3

Today I upgraded from couchdb 0.11.2 to 1.1.0. When I run my unit tests, and re-fetch my domain after an update - it still returns the initial value. This seems peculiar to ektorp since futon shows the updated values. If I change back to the older version of couchdb however, I get the green light.

I use the following format (not full implementation but shows relevant code):

```@GenerateView
public List findMyDomainObjName(String key) {
return queryView("by_domainobjname", key);
}
```

Update: The problem seems to be with @Generated. If we replace this with our own view and use:

```
ViewQuery q = createQuery("my view").descending(true);
List list = db.queryView(q, DomainObjName.class);
```

...then this works as expected.

Abhaya