Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-536

Automatic binding of results to Beans (for solrj)

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.3
    • Component/s: clients - java
    • Labels:
      None

      Description

      as we are using java5 .we can use annotations to bind SolrDocument to java beans directly.

      This can make the usage of solrj a bit simpler

      The QueryResponse class in solrj can have an extra method as follows

      public <T> List<T> getResultBeans(Class<T> klass)

      and the bean can have annotations as

      class MyBean{
      @Field("id") //name is optional
      String id;

      @Field("category")
      List<String> categories
      }

        Attachments

        1. SOLR-DocObjBinder.patch
          2 kB
          Noble Paul
        2. SOLR-536.patch
          12 kB
          Noble Paul
        3. SOLR-536.patch
          13 kB
          Noble Paul
        4. SOLR-536.patch
          19 kB
          Ryan McKinley
        5. SOLR-536.patch
          6 kB
          Noble Paul

          Activity

            People

            • Assignee:
              ryantxu Ryan McKinley
              Reporter:
              noble.paul Noble Paul
            • Votes:
              3 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: