fields = allFields;
}
Iterator itFields = fields.iterator();
while (itFields.hasNext()) {
DatabaseField field = (DatabaseField)itFields.next();
FieldDefinition fieldDef;
//gfbug3307, should use columnDefinition if it was defined.
if ((field.getColumnDefinition()!= null) && (field.getColumnDefinition().length() == 0)) {
Class type = ConversionManager.getObjectClass(field.getType());
// Default type to VARCHAR, if unknown.
if (type == null) {
type = ClassConstants.STRING;
}
fieldDef = new FieldDefinition(field.getNameDelimited(this), type);
} else {
fieldDef = new FieldDefinition(field.getNameDelimited(this), field.getColumnDefinition());
}
if (pkFields.contains(field) && shouldTempTableSpecifyPrimaryKeys()) {
fieldDef.setIsPrimaryKey(true);
}
tableDef.addField(fieldDef);
}
tableDef.setCreationPrefix(getCreateTempTableSqlPrefix());
tableDef.setName(getTempTableForTable(table).getQualifiedNameDelimited(this));