title: How to cook right a DataStax accessor with sync and async methods?
body: <p>When I write an <a href="https://docs.datastax.com/en/developer/java-driver/2.1/common/drivers/reference/accessorAnnotatedInterfaces.html" rel="nofollow">accessor</a> for an entity I usually add sync and async versions of the same query. For example:</p>
  
  <pre><code>@Accessor
  public interface SourceDataAccessor {
        @Query("select * from source_data where data_id = ?")
        Result&lt;SourceDataCass&gt; get(UUID dataId);
  
        @Query("select * from source_data where data_id = ?")
        ListenableFuture&lt;Result&lt;SourceDataCass&gt;&gt; getAsync(UUID dataId);
  }
  </code></pre>
  
  <p>But when the accessor is instantiated warnings like that appear in the log:</p>
  
  <pre><code>12:32:49,793  WARN com.datastax.driver.core.Cluster:2109 - Re-preparing already prepared query select * from source_data where data_id = ?. Please note that preparing the same query more than once is generally an anti-pattern and will likely affect performance. Consider preparing the statement only once.
  </code></pre>
  
  <p>May be there is a way to have both sync and async versions of the same query but without re-preparing?</p>