class Comment extends DbObjectBase {

    private final DbObjectType objectType;
    private final String objectName;
    private String commentText;

    public Comment(Database database, int id, DbObject obj) {
        super(database, id, getKey(obj));
        this.objectType = obj.getType();
        this.objectName = obj.getSQL();
    }

    @Override
    public DbObjectType getType() {
        return DbObjectType.COMMENT;
    }

    @Override
    public String getCreateSQL() {<FILL_FUNCTION_BODY>}

    @Override
    public void checkRename() {
        DbException.throwInternalError();
    }

    /**
     * Set the comment text.
     *
     * @param comment the text
     */
    public void setCommentText(String comment) {
        this.commentText = comment;
    }

    public String getCommentText() {
        return commentText;
    }

    /**
     * Get the comment key name for the given database object. This key name is
     * used internally to associate the comment to the object.
     *
     * @param obj the object
     * @return the key name
     */
    public static String getKey(DbObject obj) {
        return getTypeName(obj.getType()) + " " + obj.getSQL();
    }

    private static String getTypeName(DbObjectType type) {
        switch (type) {
        case FUNCTION_ALIAS:
            return "ALIAS";
        case TABLE_OR_VIEW:
            return "TABLE";
        case USER_DATATYPE:
            return "DOMAIN";
        default:
            return type.name();
        }
    }
}

        StringBuilder buff = new StringBuilder("COMMENT ON ");
        buff.append(getTypeName(objectType)).append(' ').append(objectName).append(" IS ");
        if (commentText == null) {
            buff.append("NULL");
        } else {
            buff.append(StringUtils.quoteStringSQL(commentText));
        }
        return buff.toString();
    
<methods>public void checkRename() ,public List<? extends com.lealone.db.DbObject> getChildren() ,public java.lang.String getComment() ,public com.lealone.db.Database getDatabase() ,public java.lang.String getDropSQL() ,public int getId() ,public long getModificationId() ,public java.lang.String getName() ,public java.lang.String getSQL() ,public void invalidate() ,public boolean isTemporary() ,public void removeChildrenAndResources(com.lealone.db.session.ServerSession, com.lealone.db.lock.DbObjectLock) ,public void rename(java.lang.String) ,public void setComment(java.lang.String) ,public void setDatabase(com.lealone.db.Database) ,public void setModified() ,public void setTemporary(boolean) ,public java.lang.String toString() <variables>protected java.lang.String comment,protected com.lealone.db.Database database,protected int id,protected long modificationId,protected java.lang.String name,protected boolean temporary