title: Same class mapped to multiple collections?
body: <p>I want to have template objects for a class in the database and owned/altered by clients of these objects both stored in a database. To do this I can figure out 3 options.</p>
  
  <ul>
  <li>2 classes where the owned class takes a template object to construct itself. This will create 2 nearly identical classes and constructing from the template object does not feel right to me.</li>
  <li>The same class stored in 2 collections to differentiate from template and owned object. The template objects will have one redundant field that references to a client ID for a owned object. I am not sure if I can turn off writing Indexed fields to DB if they are not initialized. Also, I cannot seem to find a way to store the same class in a different collection. I am using <code>Datastore.save(..)</code> to write to DB and it seems collection name is chosen by class name. I can alter this at class level but that still means I cannot create 2 different collections for this class.</li>
  <li>One class, one collection. I could use the <code>ownerId</code> reference field to specify the object is a template. However, the collection of owned objects will grow rapidly and templates need to be accessed often so this creates overhead.</li>
  </ul>
  
  <p>There seems to be <code>AdvancedDatastore</code>, I have not used it but it seems to have <code>AdvancedDatastore.save(String collection, T entity)</code>. However, it does not have a signature like that for update, delete and many other methods. So I am not sure how to properly use this in my scenario.</p>