public Unique[] getUniques(ClassMapping cm, boolean adapt) {
if (_uniques == null || _uniques.isEmpty())
return new Unique[0];
Iterator uniqueConstraints = _uniques.iterator();
Table table = cm.getTable();
Collection result = new ArrayList();
while (uniqueConstraints.hasNext()) {
Unique template = (Unique) uniqueConstraints.next();
Column[] templateColumns = template.getColumns();
Column[] uniqueColumns = new Column[templateColumns.length];
boolean missingColumn = true;
for (int i=0; i<uniqueColumns.length; i++) {
String columnName = templateColumns[i].getName();
Column uniqueColumn = table.getColumn(columnName);
missingColumn = (uniqueColumn == null);
if (missingColumn) {
throw new UserException(_loc.get("missing-unique-column",
cm, table, columnName));
}