[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [dtp-dev] programmatically adding to "Default Schema Filter"
|
Hey Anthos,
> I was wondering on is there a way I can add filters, programmatically or
> via org.eclipse.ui.propertyPages extension point, to "Default Schema
> Filter" on a Database connection property.
>
The filters are stored as a property on the connection profile. You should
be able to set filters on your profile using the following:
// get the existing filter settings
Properties filterProps =
connectionProfile.getProperties(ConnectionFilter.FILTER_SETTINGS_PROFILE_EXTENSION_ID);
// create your schema filter
String defaultSchemaFilterPredicate = "NOT LIKE 'SYS%'";
// add the filter to the property set
filterProps.setProperty(ConnectionFilter.SCHEMA_FILTER,defaultSchemaFilterPredicate);
// update the connection profile
connectionProfile.setProperties(ConnectionFilter.FILTER_SETTINGS_PROFILE_EXTENSION_ID,
filterProps);
Note, the filtering code is rather particular about the format of the
predicate. The best I can offer is to suggest looking at
ConnectionFilterImpl to make sure your predicate string will work with it.
The filter properties are stored using the following key format:
ConnectionFilter.*_FILTER ~ default filter key
[containerName::]+Connection.*_FILTER ~ filter key for particular
container (e.g. catalog_1::TABLE_FILTER would be the table filter used
when loading tables for all schema in catalog_1;
catalog_1::schema_a::TABLE_FILTER would be the table filter used when
loading tables for schema_a in catalog_1).
Hope that helps,
Rob