private String renderSuperClassName(DescribeSObjectResult dsr) { if (dsr.isCustom()) return BaseForceCustomObject.class.getName(); // If the standard object doesn't contain *all* the common // standard object fields, just extend the generic base class (e.g. User, UserLicense) if (!ForceJPAClassGeneratorUtils.hasAllCommonFields(dsr)) return BaseForceObject.class.getName(); return BaseForceStandardObject.class.getName(); }
_hashCode += (isCustom() ? Boolean.TRUE : Boolean.FALSE).hashCode(); _hashCode += (isCustomSetting() ? Boolean.TRUE : Boolean.FALSE).hashCode(); _hashCode += (isDeletable() ? Boolean.TRUE : Boolean.FALSE).hashCode();
java.util.Arrays.equals(this.childRelationships, other.getChildRelationships()))) && this.createable == other.isCreateable() && this.custom == other.isCustom() && this.customSetting == other.isCustomSetting() && this.deletable == other.isDeletable() &&
/** * Determines if a Force.com object has all standard Force.com fields. * * @param dsr a Force.com {@code DescribeSObjectResult} of the object * to be tested * @return {@code true} if and only if the given object contains all * common Force.com fields * @see ForceJPAClassGeneratorUtils#STANDARD_OBJECT_COMMON_FIELDS */ public static boolean hasAllCommonFields(DescribeSObjectResult dsr) { // Custom objects always have all common fields if (dsr.isCustom()) return true; // Gather up all the field names for this standard object Set<String> fieldNameSet = new HashSet<String>(); for (Field field : dsr.getFields()) { fieldNameSet.add(field.getName().toLowerCase()); } return fieldNameSet.containsAll(STANDARD_OBJECT_COMMON_FIELDS); }
@Override public List<Field> filter(DescribeSObjectResult dsr) { if (dsr.isCustom()) { // Skip all fields common to Force.com custom objects return filterInternal(dsr, CUSTOM_OBJECT_COMMON_FIELDS); } else if (ForceJPAClassGeneratorUtils.hasAllCommonFields(dsr)) { // Skip all fields common to Force.com standard objects return filterInternal(dsr, STANDARD_OBJECT_COMMON_FIELDS); } // Skip all fields common to all Force.com objects return filterInternal(dsr, ALL_OBJECT_COMMON_FIELDS); }