nlight-jdev / jcouchdb

Automatically exported from code.google.com/p/jcouchdb
Other
0 stars 0 forks source link

Add feature to set the type of a key #52

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Now it is possible to set type for ViewResult row value and that is a great 
feature. I was in a situation that I needed to parse key into the object too. 
If I may, One solution is to create another class, very similar to ViewResult 
with this semantics:

ExViewResult<MyClassKey,MyClassValue> result = 
this.getDatabase().queryView("view",MyClassKey.class,MyClassValue.class,options,
null);

Original issue reported on code.google.com by vojtech.hordejcuk on 5 Aug 2010 at 4:19

GoogleCodeExporter commented 8 years ago
I thought about that but it seemed to lead to ugly code.. code is not that 
pretty as it is with all the variants running up to some methods with double 
generic sig and lots of parameters.

As it is now, the key is of course parsed into objects, just generic ones.. So 
if the key is a [] at the root, it will be an ArrayList (by Default) and {} 
keys will be a hash map.

Original comment by ff...@gmx.de on 5 Aug 2010 at 4:25

GoogleCodeExporter commented 8 years ago
I can try to implement it in some free time and will send it to you, ok?

Original comment by vojtech.hordejcuk on 5 Aug 2010 at 4:30

GoogleCodeExporter commented 8 years ago
patches are always welcome.

Original comment by ff...@gmx.de on 5 Aug 2010 at 5:26