@@ -0,0 +1,1395 @@
+package com.google.code.morphia;%0A%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0Aimport com.google.code.morphia.annotations.Entity;%0Aimport com.google.code.morphia.annotations.Id;%0Aimport com.google.code.morphia.annotations.Reference;%0Aimport com.google.code.morphia.query.Query;%0A%0A%0A@Ignore //https://github.com/mongodb/morphia/issues/62%0Apublic class TestQueriesOnReferences extends TestBase %7B%0A  @Entity%0A  public static class ContainsPic %7B%0A    @Id%0A    String id;%0A    @Reference%0A    Pic pic;%0A    @Reference(lazy = true)%0A    Pic lazyPic;%0A  %7D%0A%0A  @Entity%0A  public static class Pic %7B%0A    @Id%0A    String id;%0A    String name;%0A  %7D%0A%0A  @Test%0A  public void testQueryOverReference() throws Exception %7B%0A%0A    final ContainsPic cpk = new ContainsPic();%0A    final Pic p = new Pic();%0A    ds.save(p);%0A    cpk.pic = p;%0A    ds.save(cpk);%0A%0A    final Query%3CContainsPic%3E query = ds.createQuery(ContainsPic.class);%0A    final ContainsPic object = query.field(%22pic%22)%0A      .equal(p)%0A      .get();%0A    Assert.assertNotNull(object);%0A%0A  %7D%0A%0A  @Test%0A  public void testQueryOverLazyReference() throws Exception %7B%0A%0A    final ContainsPic cpk = new ContainsPic();%0A    final Pic p = new Pic();%0A    ds.save(p);%0A    cpk.lazyPic = p;%0A    ds.save(cpk);%0A%0A    final Query%3CContainsPic%3E query = ds.createQuery(ContainsPic.class);%0A    Assert.assertNotNull(query.field(%22lazyPic%22)%0A      .equal(p)%0A      .get());%0A  %7D%0A%7D%0A%0A

test for issue #62