title: Hazelcast: Issue while adding index
body: <p>I have a hazelcast instance whose key is of type <code>MyObject</code> and value is an enum.
  Let's say one of the attributes of <code>MyObject</code> class is <code>date</code> which is of type <code>java.sql.Date</code>.</p>
  
  <pre><code>    class MyObject {
         private Date date;
         public Date getDate() {
           return date;
         }
         public void setDate(Date date) {
           this.date = date
         }
      }
  
  public enum MyEnum {
    TEST_ENUM;
  }
  </code></pre>
  
  <p>Also I am using predicate to filter on the keys retrieve the enum value.
  For ex:</p>
  
  <pre><code>EntryObject entryObject = new PredicateBuilder().getEntryObject();    
  PredicateBuiler predicateBuilder = entryObject.key.get(date).isNull;
  </code></pre>
  
  <p>This is how I am trying to add index:</p>
  
  <pre><code>IMap&lt;MyObject, MyEnum&gt; map = hazelcastInstance.getMap("test");    
  map.addIndex("date", true)
  </code></pre>
  
  <p>But as soon as this gets executed an exception is being thrown:</p>
  
  <pre><code>com.hazelcast.query.QueryException: java.lang.IllegalArgumentException: There is no suitable accessor for 'date' on class 'class com.main.constants.myEnum'
  at com.hazelcast.query.impl.getters.ReflectionHelper.createGetter(ReflectionHelper.java:176)
  at com.hazelcast.query.impl.getters.Extractors.instantiateGetter(Extractors.java:88)
  at com.hazelcast.query.impl.getters.Extractors.getGetter(Extractors.java:73)
  at com.hazelcast.query.impl.getters.Extractors.extract(Extractors.java:57)
  at com.hazelcast.query.impl.QueryableEntry.extractAttributeValueFromTargetObject(QueryableEntry.java:156)
  at com.hazelcast.query.impl.QueryableEntry.extractAttributeValue(QueryableEntry.java:82)
  at com.hazelcast.query.impl.QueryableEntry.getAttributeValue(QueryableEntry.java:48)
  at com.hazelcast.query.impl.QueryableEntry.getConverter(QueryableEntry.java:67)
  at com.hazelcast.query.impl.IndexImpl.saveEntryIndex(IndexImpl.java:67)
  at com.hazelcast.map.impl.operation.AddIndexOperation.run(AddIndexOperation.java:75)
  </code></pre>
  
  <p>I understand it's trying to find the index attribute in the value class</p>
  
  <p>How do I get this thing working i.e. add the index on the Key rather than on the value.</p>