}
private void bindTableUniqueConstraints(EntitySource entitySource, EntityBinding entityBinding) {
for ( ConstraintSource constraintSource : entitySource.getConstraints() ) {
if ( constraintSource instanceof UniqueConstraintSource ) {
TableSpecification table = entityBinding.locateTable( constraintSource.getTableName() );
if ( table == null ) {
// throw exception !?
}
String constraintName = constraintSource.name();
if ( constraintName == null ) {
// create a default name
}
UniqueKey uniqueKey = table.getOrCreateUniqueKey( constraintName );
for ( String columnName : constraintSource.columnNames() ) {
uniqueKey.addColumn( table.locateOrCreateColumn( quoteIdentifier( columnName ) ) );
}
}
}
}