Connection connection = null;
DatabaseCompilerManager compilerManager = DatabaseCompilerManager.getInstance(getProject());
ConnectionHandler connectionHandler = object.getConnectionHandler();
try {
connection = connectionHandler.getPoolConnection();
DatabaseMetadataInterface metadataInterface = connectionHandler.getInterfaceProvider().getMetadataInterface();
boolean isDebug = compileType == CompileType.DEBUG;
if (compileType == CompileType.KEEP) {
isDebug = object.getStatus().is(DBObjectStatus.DEBUG);
}
if (contentType == DBContentType.CODE_SPEC || contentType == DBContentType.CODE) {
metadataInterface.compileObject(
object.getSchema().getName(),
object.getName(),
object.getTypeName().toUpperCase(),
isDebug,
connection);
}
else if (contentType == DBContentType.CODE_BODY){
metadataInterface.compileObjectBody(
object.getSchema().getName(),
object.getName(),
object.getTypeName().toUpperCase(),
isDebug,
connection);
} else if (contentType == DBContentType.CODE_SPEC_AND_BODY) {
metadataInterface.compileObject(
object.getSchema().getName(),
object.getName(),
object.getTypeName().toUpperCase(),
isDebug,
connection);
metadataInterface.compileObjectBody(
object.getSchema().getName(),
object.getName(),
object.getTypeName().toUpperCase(),
isDebug,
connection);