@Test public void testConflictJavaFieldNames() { Field stdField = new Field(); stdField.setName("Field"); stdField.setType(FieldType.string); Field customField = new Field(); customField.setName("Field__c"); customField.setType(FieldType.string); customField.setCustom(true); Field refField = new Field(); refField.setName("Field__c"); refField.setType(FieldType.reference); refField.setCustom(true); refField.setRelationshipName("Field__r"); refField.setReferenceTo(new String[] { "Relationship" }); DescribeSObjectResult dsr = createDescribeSObjectResult("testConflictJavaFieldNames", stdField, customField, refField); List<Field> filteredFields = new ForceJPAFieldFilter().filter(dsr); assertEquals(filteredFields.size(), 3, "Unexpected number of fields after filtering"); assertEquals(filteredFields.get(0).getName(), "Field", "Unexpected field name after filtering"); assertEquals(filteredFields.get(1).getName(), "fieldCustom", "Unexpected field name after filtering"); assertEquals(filteredFields.get(2).getRelationshipName(), "fieldRelationship", "Unexpected relationship name after filtering"); }
@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);  }