You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Noble Paul (JIRA)" <ji...@apache.org> on 2015/02/12 10:36:12 UTC

[jira] [Comment Edited] (SOLR-1945) Allow @Field annotations in nested classes using DocumentObjectBinder

    [ https://issues.apache.org/jira/browse/SOLR-1945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14317889#comment-14317889 ] 

Noble Paul edited comment on SOLR-1945 at 2/12/15 9:35 AM:
-----------------------------------------------------------

This adds a new attribute to the existing {{@Field}} annotation

{code:java}
public @interface Field {
  public static final String DEFAULT ="#default";
  String value() default DEFAULT;
  boolean child() default false;
}
{code}
examples:
{code:java}
public class Child {
    @Field
    String id;

    @Field
    String name;

  }

  public  class SingleValueChild {
    @Field
    String id;

    @Field(child = true)
    Child child;
  }

  public static class ListChild{
    @Field
    String id;

    @Field(child = true)
    List<Child> child;

  }
  public  class ArrayChild{
    @Field
    String id;

    @Field(child = true)
    Child[] child;
  }
{code}



was (Author: noble.paul):
This adds a new attribute to the existing {{@Field}} annotation

examples:
{code:java}
public class Child {
    @Field
    String id;

    @Field
    String name;

  }

  public  class SingleValueChild {
    @Field
    String id;

    @Field(child = true)
    Child child;
  }

  public static class ListChild{
    @Field
    String id;

    @Field(child = true)
    List<Child> child;

  }
  public  class ArrayChild{
    @Field
    String id;

    @Field(child = true)
    Child[] child;
  }
{code}


> Allow @Field annotations in nested classes using DocumentObjectBinder
> ---------------------------------------------------------------------
>
>                 Key: SOLR-1945
>                 URL: https://issues.apache.org/jira/browse/SOLR-1945
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Mark Miller
>            Priority: Minor
>         Attachments: SOLR-1945.patch, SOLR-1945.patch
>
>
> see http://search.lucidimagination.com/search/document/d909d909420aeb4e/does_solrj_support_nested_annotated_beans
> Would be nice to be able to pass an object graph to solrj with @field annotations rather than just a top level class



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org