I tried something else:
- public static Collection<UniqueConstraint> getUniqueConstraints(Database database, Table table) throws DatabaseException,
InvalidExampleException { - SnapshotControl control = new SnapshotControl(database, UniqueConstraint.class);
CatalogAndSchema catalogAndSchema = new CatalogAndSchema(null, null);
DatabaseSnapshot snapshot = SnapshotGeneratorFactory.getInstance().createSnapshot(catalogAndSchema, database, control);
return snapshot.get(UniqueConstraint.class); - }
- but I get an empty set of constraints.