如果我有 foo 类型的子类 bar,那么 foo 中的方法如何查看它何时实际从 bar 的实例化运行。例子:
CREATE OR REPLACE
TYPE foo AS OBJECT
(
mxyzptlk NUMBER, -- Because PL/SQL demands you have an attribute defined.
MEMBER FUNCTION get_actual_class_name
RETURN VARCHAR2
) NOT FINAL;
/
CREATE OR REPLACE
TYPE bar UNDER foo
(
) NOT FINAL;
/
DECLARE
baz bar;
BEGIN
DBMS_OUTPUT.PUT_LINE(baz.get_actual_class_name); -- I would hope to get 'bar' back.
END;
/
在 PL/SQL OOP 中是否可以进行自省?