EOSQLExpression sqlExpr = _expressionForEntity(entityGroup.objectAtIndex(0));
for (EOEntity entity : entityGroup) {
for (EOAttribute attribute : entity.attributes()) {
String columnName = attribute.columnName();
if (!attribute.isDerived() && !attribute.isFlattened() && columnName != null && columnName.length() > 0 && !columnNames.contains(columnName)) {
sqlExpr.appendItemToListString(_columnCreationClauseForAttribute(attribute), aStatement);
columnNames.addObject(columnName);
}
}
}
return new NSArray<EOSQLExpression>(_expressionForString(new StringBuilder().append("CREATE TABLE ").append(formatTableName(entityGroup.objectAtIndex(0).externalName())).append(" (").append(aStatement.toString()).append(')').toString()));