*
* @return an array of EOSQLExpressions for setting the primary key constraint of this table
*/
@SuppressWarnings("unchecked")
public NSArray<EOSQLExpression> _setPrimaryKeyExpressions(ERXMigrationColumn... columns) {
EOSchemaGeneration schemaGeneration = _database.synchronizationFactory();
EOEntity entity = columns[0].table()._blankEntity();
NSMutableArray<EOAttribute> attributes = new NSMutableArray<EOAttribute>();
for (ERXMigrationColumn column : columns) {
EOAttribute attribute = column._newAttribute(entity);
attributes.addObject(attribute);
}
entity.setPrimaryKeyAttributes(attributes);
NSArray<EOSQLExpression> expressions = schemaGeneration.primaryKeyConstraintStatementsForEntityGroup(new NSArray<EOEntity>(entity));
ERXMigrationDatabase._ensureNotEmpty(expressions, "add primary key", true);
NSArray<EOSQLExpression> supportExpressions = schemaGeneration.primaryKeySupportStatementsForEntityGroup(new NSArray<EOEntity>(entity));
return expressions.arrayByAddingObjectsFromArray(supportExpressions);
}