title: GridGain join query for two objects
body: <p>I am using GridGain as local in-memory storage of my data objects (pojos) and I need to query those objects and select the proper one with specific values. Lets consider the following situation:</p>
  
  <pre><code>class Person {
  
      public Long id;
      public String name;
      public Organization organization;
  }
  
  class Organization{
  
    public Long id;
    public String name;
  }
  </code></pre>
  
  <p>Could you advice how to make query to retrieve e.g. all Persons for certain Organization? 
  I tried following:</p>
  
  <pre><code>final GridCacheProjection&lt;GridCacheAffinityKey&lt;Long&gt;, Person&gt; appCache = cache.projection(GridCacheAffinityKey.class, Person.class);
  
  final GridCacheQuery&lt;Map.Entry&lt;GridCacheAffinityKey&lt;Long&gt;, Person&gt;&gt; query = appCache.queries().createSqlQuery(Person.class, "from Person, Organization " + "where Person.organization.id = " + "Organization.id = ?");
  </code></pre>
  
  <p>But no luck. I found a lot of examples using Person.id = Organization.id = ? however I have Organization as an object in Person class so how to write a query or retrieve data in this way?</p>
  
  <p>Thanks in advance for any hint.</p>