/** * Method returns names of the fields specified. * @param fields fields * @return fields' names * @throws KettleException in case of error * @see #getObjectFields(String) */ public String[] getFields( Field[] fields ) throws KettleException { if ( fields != null ) { int nrFields = fields.length; String[] fieldsMapp = new String[nrFields]; for ( int i = 0; i < nrFields; i++ ) { Field field = fields[i]; fieldsMapp[i] = field.getName(); } return fieldsMapp; } return null; }
private void addField( Field field ) { String fieldType = field.getType().toString(); String fieldLength = null; String fieldPrecision = null; if ( !fieldType.equals( "boolean" ) && !fieldType.equals( "datetime" ) && !fieldType.equals( "date" ) ) { fieldLength = Integer.toString( field.getLength() ); fieldPrecision = Integer.toString( field.getPrecision() ); } addFieldToTable( field.getLabel(), field.getName(), field.isIdLookup(), field.getType().toString(), fieldLength, fieldPrecision ); }
for ( int i = 0; i < fields.length; i++ ) { Field field = fields[i]; fieldsName[i] = field.getName(); addField( field );
public String getFieldName() { return field != null ? field.getName() : fieldName; }
public String getFieldName() { return field != null ? field.getName() : fieldName; }
/** * 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); }
/** * Retrieves the object's metadata * * @param c SFDC stub * @param name SFDC object name * @return Map of fields * @throws RemoteException communication error */ protected static Map<String, Field> describeObject(SoapBindingStub c, String name) throws RemoteException { l.debug("Retrieving SFDC object " + name + " metadata."); Map<String, Field> result = new HashMap<String, Field>(); DescribeSObjectResult describeSObjectResult = c.describeSObject(name); if (!(describeSObjectResult == null)) { Field[] fields = describeSObjectResult.getFields(); if (fields != null) { for (Field field : fields) { result.put(field.getName(), field); } } } l.debug("SFDC object " + name + " metadata retrieved."); return result; }
Field field = fieldIter.next(); String fieldNameLower = field.getName().toLowerCase(); String javaFieldName = renderJavaName(field, true /*firstCharLowerCase*/);
/** * Constructs a valid Java name from a Force.com API {@code Field} object name. * * @param field a Force.com API {@code Field} object whose name is to * to converted to a Java name * @param firstCharLowerCase indicates if the first character in the constructed Java * name should be lower case * @return a non {@code null} {@code String} which conforms * to Java naming standards */ public static String renderJavaName(Field field, boolean firstCharLowerCase) { if (useRelationshipName(field)) { return renderJavaName(field.getRelationshipName(), "Field", firstCharLowerCase); } return renderJavaName(field.getName(), "Field", firstCharLowerCase); }
String columnName = field.getName().toLowerCase(); ColumnImpl column = new ColumnImpl(columnName, field); columnList.add(column);
String columnName = field.getName().toLowerCase(); ColumnImpl column = new ColumnImpl(columnName, field); columnList.add(column);
private String renderGetterAnnotation(Field field, JPAAnnotationBuilder builder) { String name = field.getName(); FieldType type = field.getType(); if (type == FieldType.id) {
for (Field field : in.getFields()) { Schema.Field avroField = new Schema.Field(field.getName(), inferSchema(field), null, field.getDefaultValueFormula());
for (Field field : in.getFields()) { Schema.Field avroField = new Schema.Field(field.getName(), inferSchema(field), null, field.getDefaultValueFormula());
Schema.Field avroField = new Schema.Field(field.getName(), salesforceField2AvroTypeSchema(field), null, field.getDefaultValueFormula());
Schema.Field avroField = new Schema.Field(field.getName(), salesforceField2AvroTypeSchema(field), null, field.getDefaultValueFormula());
final String columnName = field.getName(); final String columnLabel = field.getLabel(); final Boolean nillable = field.isNillable();
final String columnName = field.getName(); final String columnLabel = field.getLabel(); final Boolean nillable = field.isNillable();
final String columnName = field.getName(); final String columnLabel = field.getLabel(); final Boolean nillable = field.isNillable();