use of com.cubrid.cubridmanager.core.cubrid.table.task.GetSchemaTask in project cubrid-manager by CUBRID.
the class SchemaProvider method getSchema.
/**
* Retrieves the schema of database object.
*
* @return schema of table.
*/
public SchemaInfo getSchema() {
GetSchemaTask jdbcTask = new GetSchemaTask(dbInfo, tableName);
jdbcTask.execute();
errorMessage = jdbcTask.getErrorMsg();
return jdbcTask.getSchema();
}
use of com.cubrid.cubridmanager.core.cubrid.table.task.GetSchemaTask in project cubrid-manager by CUBRID.
the class SchemaProvider method getSchema.
/**
* Retrieves the schema of database object.
*
* @return schema of table.
*/
public SchemaInfo getSchema(Connection connection) {
GetSchemaTask jdbcTask = new GetSchemaTask(connection, dbInfo, tableName);
jdbcTask.execute();
errorMessage = jdbcTask.getErrorMsg();
return jdbcTask.getSchema();
}
use of com.cubrid.cubridmanager.core.cubrid.table.task.GetSchemaTask in project cubrid-manager by CUBRID.
the class ColumnProposalAdvisor method loadProposal.
/**
* Load proposal for table
*
* @param databaseInfo
* @param tableName
* @param proposal
*/
private void loadProposal(final DatabaseInfo databaseInfo, final String tableName, final ColumnProposal proposal) {
Job job = new Job("Load schema information job") {
protected IStatus run(IProgressMonitor monitor) {
LOGGER.info("Load table info in ColumnProposalHandler");
GetSchemaTask getSchemaTask = null;
try {
getSchemaTask = new GetSchemaTask(databaseInfo, tableName, monitor);
getSchemaTask.setNeedCollationInfo(false);
getSchemaTask.execute();
if (getSchemaTask.isSuccess()) {
SchemaInfo schemaInfo = getSchemaTask.getSchema();
if (schemaInfo != null) {
List<ColumnProposalDetailInfo> columnList = new ArrayList<ColumnProposalDetailInfo>();
for (DBAttribute attr : schemaInfo.getAttributes()) {
columnList.add(new ColumnProposalDetailInfo(schemaInfo, attr));
}
proposal.addSchemaInfo(tableName, schemaInfo, columnList);
}
}
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
} finally {
getSchemaTask.finish();
}
return Status.OK_STATUS;
}
};
job.schedule();
}
Aggregations