@Test void createDefaultEntityFetchRefs() { Fetch fetch = new Fetch() .field(ID_ATTR_NAME) .field(LABEL_ATTR_NAME) .field( COMPOUND_PART_FILE_ATTR_NAME, new Fetch() .field(FileMetaMetadata.ID) .field(FileMetaMetadata.FILENAME) .field(FileMetaMetadata.URL)) .field(XREF_ATTR_NAME, new Fetch().field(REF_ID_ATTR_NAME).field(REF_LABEL_ATTR_NAME)) .field(COMPOUND_PART_COMPOUND_PART_ATTR_NAME) .field(COMPOUND_PART_COMPOUND_PART_ATTR2_NAME); assertEquals(fetch, createDefaultEntityFetch(entityType, "en")); }
public static Fetch createDefaultEntityFetch(EntityType entityType, String languageCode) { boolean hasRefAttr = false; Fetch fetch = new Fetch(); for (Attribute attr : entityType.getAtomicAttributes()) { Fetch subFetch = createDefaultAttributeFetch(attr, languageCode); if (subFetch != null) { hasRefAttr = true; } fetch.field(attr.getName(), subFetch); } return hasRefAttr ? fetch : null; }
AttributeFilterToFetchConverter { public static Fetch createDefaultEntityFetch(EntityType entityType, String languageCode) { boolean hasRefAttr = false; Fetch fetch = new Fetch(); for (Attribute attr : entityType.getAtomicAttributes()) { Fetch subFetch = createDefaultAttributeFetch(attr, languageCode); if (subFetch != null) { hasRefAttr = true; } fetch.field(attr.getName(), subFetch); } return hasRefAttr ? fetch : null; } }
AttributeFilterToFetchConverter { public static Fetch createDefaultEntityFetch(EntityType entityType, String languageCode) { boolean hasRefAttr = false; Fetch fetch = new Fetch(); for (Attribute attr : entityType.getAtomicAttributes()) { Fetch subFetch = createDefaultAttributeFetch(attr, languageCode); if (subFetch != null) { hasRefAttr = true; } fetch.field(attr.getName(), subFetch); } return hasRefAttr ? fetch : null; } private  AttributeFilterToFetchConverter(); }
AttributeFilterToFetchConverter { public static Fetch createDefaultEntityFetch(EntityType entityType, String languageCode) { boolean hasRefAttr = false; Fetch fetch = new Fetch(); for (Attribute attr : entityType.getAtomicAttributes()) { Fetch subFetch = createDefaultAttributeFetch(attr, languageCode); if (subFetch != null) { hasRefAttr = true; } fetch.field(attr.getName(), subFetch); } return hasRefAttr ? fetch : null; } private  AttributeFilterToFetchConverter(); static Fetch convert(
      AttributeFilter attrFilter, EntityType entityType, String languageCode); static Fetch createDefaultEntityFetch(EntityType entityType, String languageCode); static Fetch createDefaultAttributeFetch(Attribute attr, String languageCode); }
AttributeFilterToFetchConverter { public static Fetch createDefaultEntityFetch(EntityType entityType, String languageCode) { boolean hasRefAttr = false; Fetch fetch = new Fetch(); for (Attribute attr : entityType.getAtomicAttributes()) { Fetch subFetch = createDefaultAttributeFetch(attr, languageCode); if (subFetch != null) { hasRefAttr = true; } fetch.field(attr.getName(), subFetch); } return hasRefAttr ? fetch : null; } private  AttributeFilterToFetchConverter(); static Fetch convert(
      AttributeFilter attrFilter, EntityType entityType, String languageCode); static Fetch createDefaultEntityFetch(EntityType entityType, String languageCode); static Fetch createDefaultAttributeFetch(Attribute attr, String languageCode);  }