title: In Play! application base document fields are not persisted to mongo db (reactive mongo plugin)
body: <p>I have Play 2.3 appliction with reactive mongo plugin.
  I have base document:</p>
  
  <pre><code>trait TemporalDocument {
    val created: Option[DateTime] = Some(new DateTime())
    val updated: Option[DateTime] = Some(new DateTime())
  }
  </code></pre>
  
  <p>and one of the concrete document:</p>
  
  <pre><code>case class User(name: String) extends TemporalDocument
  
  object User{
    implicit val userFormat = Json.format[User]
  }
  </code></pre>
  
  <p>So when I persist it to mongo db using reactive mongo plugin only name is persisted, created/updated fields are not.</p>
  
  <p>My repository looks like:</p>
  
  <pre><code>trait MongoDocumentRepository[T &lt;: TemporalDocument] extends ContextHolder {
  
    private val db = ReactiveMongoPlugin.db
  
    def insert(document: T)(implicit writer: Writes[T]): Future[String] = {
      collection.insert(document).map {
        lastError =&gt; lastError.toString
      } recover {
        case e: Exception =&gt; sys.error(e.getMessage)
      }
    }
  
    private def collection: JSONCollection = db.collection[JSONCollection](collectionName)
  
    implicit object BSONDateTimeHandler extends BSONHandler[BSONDateTime, DateTime] {
      def read(time: BSONDateTime) = new DateTime(time.value)
  
      def write(jdtime: DateTime) = BSONDateTime(jdtime.getMillis)
    }
  }
  </code></pre>
  
  <p>Problem is that I will have many documents extended from base document and I do not want each time init those dates and probably some other fields. Is it possible to do something like this?</p>