class MetaRecord implements Comparable<MetaRecord> {

    public static Row getRow(Table metaTable, DbObject obj) {
        Row Row = metaTable.getTemplateRow();
        Row.setValue(0, ValueInt.get(obj.getId()));
        Row.setValue(1, ValueInt.get(obj.getType().value));
        Row.setValue(2, ValueString.get(obj.getCreateSQL()));
        return Row;
    }

    private final int id;
    private final DbObjectType objectType;
    private final String sql;

    public MetaRecord(SearchRow r) {
        id = r.getValue(0).getInt();
        objectType = DbObjectType.TYPES[r.getValue(1).getInt()];
        sql = r.getValue(2).getString();
    }

    public int getId() {
        return id;
    }

    /**
     * Execute the meta data statement.
     *
     * @param db the database
     * @param systemSession the system session
     * @param listener the database event listener
     */
    public void execute(Database db, ServerSession systemSession, DatabaseEventListener listener) {
        execute(db, systemSession, listener, sql, id);
    }

    public static void execute(Database db, ServerSession systemSession, DatabaseEventListener listener,
            String sql, int id) {<FILL_FUNCTION_BODY>}

    /**
     * Sort the list of meta records by 'create order'.
     *
     * @param other the other record
     * @return -1, 0, or 1
     */
    @Override
    public int compareTo(MetaRecord other) {
        int c1 = objectType.createOrder;
        int c2 = other.objectType.createOrder;
        if (c1 != c2) {
            return c1 - c2;
        }
        return getId() - other.getId();
    }

    @Override
    public String toString() {
        return "MetaRecord [id=" + id + ", objectType=" + objectType + ", sql=" + sql + "]";
    }
}

        try {
            PreparedSQLStatement command = systemSession.prepareStatementLocal(sql);
            // 设置好数据库对象id，这样在执行create语句创建数据库对象时就能复用上一次得到的id了
            command.setObjectId(id);
            systemSession.executeUpdateLocal(command);
        } catch (DbException e) {
            e = e.addSQL(sql);
            SQLException s = e.getSQLException();
            db.getTrace(TraceModuleType.DATABASE).error(s, sql);
            if (listener != null) {
                listener.exceptionThrown(s, sql);
                // continue startup in this case
            } else {
                throw e;
            }
        }
    
<no_super_class>