use of org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext in project dbeaver by serge-rider.
the class MySQLDataSource method setDefaultObject.
@Override
public void setDefaultObject(@NotNull DBRProgressMonitor monitor, @NotNull DBSObject object) throws DBException {
final MySQLCatalog oldSelectedEntity = getDefaultObject();
if (!(object instanceof MySQLCatalog)) {
throw new DBException("Invalid object type: " + object);
}
for (JDBCExecutionContext context : getAllContexts()) {
useDatabase(monitor, context, (MySQLCatalog) object);
}
activeCatalogName = object.getName();
// Send notifications
if (oldSelectedEntity != null) {
DBUtils.fireObjectSelect(oldSelectedEntity, false);
}
if (this.activeCatalogName != null) {
DBUtils.fireObjectSelect(object, true);
}
}
use of org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext in project dbeaver by serge-rider.
the class GenericCatalog method setDefaultObject.
@Override
public void setDefaultObject(@NotNull DBRProgressMonitor monitor, @NotNull DBSObject object) throws DBException {
final GenericSchema oldSelectedEntity = getDefaultObject();
// }
if (!(object instanceof GenericSchema)) {
throw new DBException("Bad child type: " + object);
}
if (!schemas.contains(GenericSchema.class.cast(object))) {
throw new DBException("Wrong child object specified as active: " + object);
}
GenericDataSource dataSource = getDataSource();
for (JDBCExecutionContext context : dataSource.getAllContexts()) {
dataSource.setActiveEntityName(monitor, context, object);
}
if (oldSelectedEntity != null) {
DBUtils.fireObjectSelect(oldSelectedEntity, false);
}
DBUtils.fireObjectSelect(object, true);
}
use of org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext in project dbeaver by dbeaver.
the class MSSQLDataSource method setDefaultObject.
@Override
public void setDefaultObject(DBRProgressMonitor monitor, DBSObject object) throws DBException {
final MSSQLDatabase oldSelectedEntity = getDefaultObject();
if (!(object instanceof MSSQLDatabase)) {
throw new DBException("Invalid object type: " + object);
}
for (JDBCExecutionContext context : getAllContexts()) {
useDatabase(monitor, context, (MSSQLDatabase) object);
}
activeDatabaseName = object.getName();
// Send notifications
if (oldSelectedEntity != null) {
DBUtils.fireObjectSelect(oldSelectedEntity, false);
}
if (this.activeDatabaseName != null) {
DBUtils.fireObjectSelect(object, true);
}
}
use of org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext in project dbeaver by dbeaver.
the class GenericCatalog method setDefaultObject.
@Override
public void setDefaultObject(@NotNull DBRProgressMonitor monitor, @NotNull DBSObject object) throws DBException {
final GenericSchema oldSelectedEntity = getDefaultObject();
// }
if (!(object instanceof GenericSchema)) {
throw new DBException("Bad child type: " + object);
}
if (!schemas.contains(GenericSchema.class.cast(object))) {
throw new DBException("Wrong child object specified as active: " + object);
}
GenericDataSource dataSource = getDataSource();
for (JDBCExecutionContext context : dataSource.getAllContexts()) {
dataSource.setActiveEntityName(monitor, context, object);
}
if (oldSelectedEntity != null) {
DBUtils.fireObjectSelect(oldSelectedEntity, false);
}
DBUtils.fireObjectSelect(object, true);
}
use of org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext in project dbeaver by dbeaver.
the class OracleDataSource method setDefaultObject.
@Override
public void setDefaultObject(@NotNull DBRProgressMonitor monitor, @NotNull DBSObject object) throws DBException {
final OracleSchema oldSelectedEntity = getDefaultObject();
if (!(object instanceof OracleSchema)) {
throw new IllegalArgumentException("Invalid object type: " + object);
}
for (JDBCExecutionContext context : getAllContexts()) {
setCurrentSchema(monitor, context, (OracleSchema) object);
}
activeSchemaName = object.getName();
// Send notifications
if (oldSelectedEntity != null) {
DBUtils.fireObjectSelect(oldSelectedEntity, false);
}
if (this.activeSchemaName != null) {
DBUtils.fireObjectSelect(object, true);
}
}
Aggregations