提交 61b0a0ac 编写于 作者: N Nikita Akilov

#9485 codestyle fixes

上级 1c4bef5f
......@@ -65,6 +65,7 @@ public class SQLServerGenericTable extends GenericTable implements DBPOverloaded
return super.getDescription();
}
@Override
@Property(viewable = true, multiline = true, order = 100)
public String getDescription(DBRProgressMonitor monitor) throws DBException {
String description = getDescription();
......
......@@ -142,12 +142,6 @@ public abstract class OracleTableBase extends JDBCTable<OracleDataSource, Oracle
@Property(viewable = true, editable = true, updatable = true, multiline = true, order = 100)
@LazyProperty(cacheValidator = CommentsValidator.class)
public String getComment(DBRProgressMonitor monitor) {
return getDescription();
}
@Nullable
@Override
public String getDescription(DBRProgressMonitor monitor) {
if (comment == null) {
try (JDBCSession session = DBUtils.openMetaSession(monitor, this, "Load table comments")) {
comment = queryTableComment(session);
......@@ -161,6 +155,12 @@ public abstract class OracleTableBase extends JDBCTable<OracleDataSource, Oracle
return comment;
}
@Nullable
@Override
public String getDescription(DBRProgressMonitor monitor) {
return getComment(monitor);
}
protected String queryTableComment(JDBCSession session) throws SQLException {
return JDBCUtils.queryString(
session,
......
......@@ -197,17 +197,17 @@ public class OracleTableColumn extends JDBCTableColumn<OracleTableBase> implemen
@Nullable
@Override
public String getDescription(DBRProgressMonitor monitor) {
if (comment == null) {
// Load comments for all table columns
getTable().loadColumnComments(monitor);
}
return comment;
return getComment(monitor);
}
@Property(viewable = true, editable = true, updatable = true, multiline = true, order = 100)
@LazyProperty(cacheValidator = CommentLoadValidator.class)
public String getComment(DBRProgressMonitor monitor) {
return getDescription(monitor);
if (comment == null) {
// Load comments for all table columns
getTable().loadColumnComments(monitor);
}
return comment;
}
public void setComment(String comment)
......
......@@ -18,6 +18,7 @@ package org.jkiss.dbeaver.ext.postgresql.model;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.DBPObjectWithLazyDescription;
import org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils;
import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
......@@ -31,7 +32,7 @@ import java.util.List;
/**
* PostgreAggregate
*/
public class PostgreAggregate implements PostgreObject {
public class PostgreAggregate implements PostgreObject, DBPObjectWithLazyDescription {
private long oid;
private PostgreSchema schema;
......@@ -114,6 +115,7 @@ public class PostgreAggregate implements PostgreObject {
return null;
}
@Override
@Property(viewable = true, multiline = true, order = 100)
public String getDescription(DBRProgressMonitor monitor) throws DBException {
PostgreProcedure function = getFunction(monitor);
......
......@@ -270,6 +270,7 @@ public class PostgreDatabase extends JDBCRemoteInstance
return JDBCExecutionContext.TYPE_METADATA + " <" + getName() + ">";
}
@Override
@Property(viewable = true, editable = true, updatable = true, multiline = true, order = 100)
public String getDescription(DBRProgressMonitor monitor) {
if (!getDataSource().getServerType().supportsDatabaseDescription()) {
......
......@@ -22,8 +22,7 @@ import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
public interface DBPObjectWithLazyDescription extends DBPObjectWithDescription {
/**
* Loads description and returns it. Consequent calls of getDescription()
* will return loaded description.
* Loads description and returns it.
*
* @return object description or null
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册