Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/392.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 设置JDO中所属关系的fetchSize_Java_Google App Engine_Jdo - Fatal编程技术网

Java 设置JDO中所属关系的fetchSize

Java 设置JDO中所属关系的fetchSize,java,google-app-engine,jdo,Java,Google App Engine,Jdo,是否有方法控制用于所属关系的提取大小 例如: @PersistenceCapable public class Employee { /** The contact info sets. */ @Persistent(defaultFetchGroup = "true") @Element(dependent = "true") private Collection<ContactInfo> contactInfoSets; /** The key. */

是否有方法控制用于所属关系的提取大小

例如:

@PersistenceCapable
public class Employee {

  /** The contact info sets. */
  @Persistent(defaultFetchGroup = "true")
  @Element(dependent = "true")
  private Collection<ContactInfo> contactInfoSets;

  /** The key. */
  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key key;

  public Collection<ContactInfo> getContactInfo() {
    return contactInfoSets;
  }

}

@PersistenceCapable
public class ContactInfo {

  /** The key. */
  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key key;

}
它将获取20人组中的所有联系人。如何告诉jdo在一个查询中获取所有联系人


PS:我试图设置
pm.getFetchPlan().setFetchSize(FetchPlan.FETCH\u SIZE\u贪婪)未成功。

FetchPlan.setFetchSize显然是供查询使用的,没有其他用途(根据规范)。 使用GAE JDO插件的v2应该加载所有关系对象,而不需要对DB进行任何额外的调用(因为相关对象的ID存储在所属对象中)。日志告诉您进行了哪些数据存储调用

Employee e = pm.getObjectById(Employee.class, "1");
e.getContactInfoSets();