@Test public void testSelectStandardObjectWithAllCommonFields() { Field idField = new Field(); idField.setName("Id"); idField.setType(FieldType.id); Field nameField = new Field(); nameField.setName("Name"); nameField.setType(FieldType.string); Field deletedField = new Field(); deletedField.setName("IsDeleted"); deletedField.setType(FieldType._boolean); Field ownerField = new Field(); ownerField.setName("OwnerId"); ownerField.setType(FieldType.reference); ownerField.setReferenceTo(new String[] { "User" }); Field createdByIdField = new Field(); createdByIdField.setName("CreatedById"); createdByIdField.setType(FieldType.reference); createdByIdField.setReferenceTo(new String[] { "User" }); Field createdDateField = new Field(); createdDateField.setName("CreatedDate"); createdDateField.setType(FieldType.datetime); Field lastModifiedByIdField = new Field(); lastModifiedByIdField.setName("LastModifiedById"); lastModifiedByIdField.setType(FieldType.reference); lastModifiedByIdField.setReferenceTo(new String[] { "User" }); Field lastModifiedDateField = new Field(); lastModifiedDateField.setName("LastModifiedDate"); lastModifiedDateField.setType(FieldType.datetime); Field systemModstampField = new Field(); systemModstampField.setName("SystemModstamp"); systemModstampField.setType(FieldType.datetime); Field customField = new Field(); customField.setName("CustomField__c"); customField.setType(FieldType.string); DescribeSObjectResult dsr = createDescribeSObjectResult("testSelectStandardObjectWithAllCommonFields", idField, nameField, deletedField, ownerField, createdByIdField, createdDateField, lastModifiedByIdField, lastModifiedDateField, systemModstampField, customField); dsr.setCustom(false); List<Field> filteredFields = new ForceJPAFieldFilter().filter(dsr); assertFilteredFields(filteredFields, Lists.newArrayList("IsDeleted", "CreatedById", "LastModifiedById", "CustomField__c")); }
@Override public List<Field> filter(DescribeSObjectResult dsr) { if (dsr.isCustom()) { return filterInternal(dsr, CUSTOM_OBJECT_COMMON_FIELDS); } else if (ForceJPAClassGeneratorUtils.hasAllCommonFields(dsr)) { return filterInternal(dsr, STANDARD_OBJECT_COMMON_FIELDS); } return filterInternal(dsr, ALL_OBJECT_COMMON_FIELDS); }
ForceJPAFieldFilter implements FieldFilter { @Override public List<Field> filter(DescribeSObjectResult dsr) { if (dsr.isCustom()) { return filterInternal(dsr, CUSTOM_OBJECT_COMMON_FIELDS); } else if (ForceJPAClassGeneratorUtils.hasAllCommonFields(dsr)) { return filterInternal(dsr, STANDARD_OBJECT_COMMON_FIELDS); } return filterInternal(dsr, ALL_OBJECT_COMMON_FIELDS); } }
ForceJPAFieldFilter implements FieldFilter { @Override public List<Field> filter(DescribeSObjectResult dsr) { if (dsr.isCustom()) { return filterInternal(dsr, CUSTOM_OBJECT_COMMON_FIELDS); } else if (ForceJPAClassGeneratorUtils.hasAllCommonFields(dsr)) { return filterInternal(dsr, STANDARD_OBJECT_COMMON_FIELDS); } return filterInternal(dsr, ALL_OBJECT_COMMON_FIELDS); }  }
ForceJPAFieldFilter implements FieldFilter { @Override public List<Field> filter(DescribeSObjectResult dsr) { if (dsr.isCustom()) { return filterInternal(dsr, CUSTOM_OBJECT_COMMON_FIELDS); } else if (ForceJPAClassGeneratorUtils.hasAllCommonFields(dsr)) { return filterInternal(dsr, STANDARD_OBJECT_COMMON_FIELDS); } return filterInternal(dsr, ALL_OBJECT_COMMON_FIELDS); }  @Override List<Field> filter(DescribeSObjectResult dsr); }
ForceJPAFieldFilter implements FieldFilter { @Override public List<Field> filter(DescribeSObjectResult dsr) { if (dsr.isCustom()) { return filterInternal(dsr, CUSTOM_OBJECT_COMMON_FIELDS); } else if (ForceJPAClassGeneratorUtils.hasAllCommonFields(dsr)) { return filterInternal(dsr, STANDARD_OBJECT_COMMON_FIELDS); } return filterInternal(dsr, ALL_OBJECT_COMMON_FIELDS); }  @Override List<Field> filter(DescribeSObjectResult dsr);  }