Re: Solrj @Field getter annotation
On Mon, Feb 22, 2010 at 11:50 PM, Norman Wiechmann n.wiechm...@gmx.net wrote: Noble Paul നോബിള് नोब्ळ् wrote: if it is not provided with setters , what do you suggest? provide it with getters? yes, i would like to have the @Field annotation at getters. and if there is no reason against this i can provide a patch for DocumentObjectBinder that adds getter annotation and keeps the setter annotation for backward compatibility. I personally don't think it makes a lot of difference just because other JPA tools don't follow that pattern. So removing the annotation from the setter is not required best, Norman -- - Noble Paul | Systems Architect| AOL | http://aol.com
Re: Solrj @Field getter annotation
if it is not provided with setters , what do you suggest? provide it with getters? On Mon, Feb 22, 2010 at 2:09 PM, Norman Wiechmann n.wiechm...@gmx.net wrote: Noble Paul നോബിള് नोब्ळ् schrieb: On Sun, Feb 21, 2010 at 11:04 PM, Norman Wiechmann n.wiechm...@gmx.net wrote: Hi, I'm wondering if there is a reason why the @Field annotation is restricted to setters? The preferred way is to apply the annotation to fields. it is provided on setters also if you prefer the set/get xxx() route. Ok, but fields are not my prefered way. I don't want to store all values required for the index into extra fields. As described in my first mail, I intend to use the annotation to generate index fields only, not to read them. So there is no need to have always a field. Sometimes I would like to create an solr annotated wrapper to the business object and sometimes I would like to annotate my business object directly. In my case I would like to index beans from java using the solrj client implementation. Transforming documents to beans is not required because I use queries to Solr from JavaScript only. To avoid the creation of setter methods just to use the @Field annotation I extended SolrServer to overwrite getBinder() and added an DocumentObjectBinder implementation that supports @Field annotations at bean property getter methods. For me it feels very unusual to add annotations to setters. It does not match with the experience I have from other libraries like JPA or JAXB. Best, Norman -- - Noble Paul | Systems Architect| AOL | http://aol.com
Re: Solrj @Field getter annotation
Noble Paul നോബിള് नोब्ळ् wrote: if it is not provided with setters , what do you suggest? provide it with getters? yes, i would like to have the @Field annotation at getters. and if there is no reason against this i can provide a patch for DocumentObjectBinder that adds getter annotation and keeps the setter annotation for backward compatibility. best, Norman
Solrj @Field getter annotation
Hi, I'm wondering if there is a reason why the @Field annotation is restricted to setters? In my case I would like to index beans from java using the solrj client implementation. Transforming documents to beans is not required because I use queries to Solr from JavaScript only. To avoid the creation of setter methods just to use the @Field annotation I extended SolrServer to overwrite getBinder() and added an DocumentObjectBinder implementation that supports @Field annotations at bean property getter methods. For me it feels very unusual to add annotations to setters. It does not match with the experience I have from other libraries like JPA or JAXB. Best, Norman
Re: Solrj @Field getter annotation
On Sun, Feb 21, 2010 at 11:04 PM, Norman Wiechmann n.wiechm...@gmx.net wrote: Hi, I'm wondering if there is a reason why the @Field annotation is restricted to setters? The preferred way is to apply the annotation to fields. it is provided on setters also if you prefer the set/get xxx() route. In my case I would like to index beans from java using the solrj client implementation. Transforming documents to beans is not required because I use queries to Solr from JavaScript only. To avoid the creation of setter methods just to use the @Field annotation I extended SolrServer to overwrite getBinder() and added an DocumentObjectBinder implementation that supports @Field annotations at bean property getter methods. For me it feels very unusual to add annotations to setters. It does not match with the experience I have from other libraries like JPA or JAXB. Best, Norman -- - Noble Paul | Systems Architect| AOL | http://aol.com