title: Hibernate OGM - java.lang.StringIndexOutOfBoundsException: String index out of range: -1
body: <p>I'm not able to retrieve this document in JPQL using the inner id</p>
  
  <pre><code>{
      "_id" : {
          "activity_id" : NumberLong(1),
          "id" : NumberLong(629364456)
      },
      "date" : ISODate("2018-12-22T23:41:22.951Z"),
      "sys_date" : ISODate("2018-12-22T23:41:22.951Z"),
      "disable_revision" : 0,
      "type" : "myMongoEvent",
      "title" : "ref title",
      "revision" : "0.0",
      "freeze" : false,
      "user_id" : 0,
      "syncdate" : ISODate("2018-12-22T23:41:22.951Z"),
      "undelable" : 0,
      "username" : ""
  }
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>Query query = entitymanager.createQuery("SELECT e.title FROM Event e WHERE e.id.id=:id");
  query.setParameter("id",2046229248L);
  List results = query.getResultList();
  </code></pre>
  
  <p><strong>It works if I query for a plain string field like <code>title</code>.</strong></p>
  
  <p>It doesn't if I query using the id of the compound index (I need a compound index).</p>
  
  <p>I get the error <code>java.lang.StringIndexOutOfBoundsException: String index out of range: -1</code> even if I query for a non existent <code>title</code>..I should simply get null results, why an exception is thrown?</p>