title: How do I create a compound unique index in Morphia/MongoDB Java?
body: <p>Let's say I have a MongoDB Entity that looks as follows:</p>
  
  <pre><code>@Entity(value = "car")
  public class Car {
     public String manufacturer;
     public String model;
     public String year;
     public Double price;
  }
  </code></pre>
  
  <p>I would like to add an index such that the pair <code>manufacturer,model,year</code> is unique.</p>
  
  <p>When I try the following annotation -- <code>@Indexes(@Index(value="manufacturer,model,year, unique=true))</code> -- it works. But it throws the following error:</p>
  
  <pre><code>[WARN] (main) : DatastoreImpl - This index on 'Car' is using deprecated configuration options.  Please update to use the fields value on @Index: @org.mongodb.morphia.annotations.Index(unique=true, dropDups=false, background=false, name=, value=manufacturer, model, year, expireAfterSeconds=-1, disableValidation=false, sparse=false, fields=[], options=@org.mongodb.morphia.annotations.IndexOptions(unique=false, dropDups=false, background=false, name=, expireAfterSeconds=-1, disableValidation=false, language=, languageOverride=, sparse=false))
  </code></pre>
  
  <p>How do I configure the index properly?</p>