Recompiling base object type and ORA-02303 [message #291193] |
Thu, 03 January 2008 06:09  |
Buchas
Messages: 101 Registered: March 2006
|
Senior Member |
|
|
Hello,
I have created a hierarchy of objects in Oracle. The base object is this:
CREATE OR REPLACE TYPE CommonObj IS OBJECT
(
nID NUMBER,
FINAL MAP MEMBER FUNCTION GetID RETURN NUMBER ,
FINAL MEMBER PROCEDURE SetID ( nIDParm IN NUMBER ),
FINAL MEMBER FUNCTION IsInitialised RETURN BOOLEAN
) NOT FINAL NOT INSTANTIABLE ;
CREATE OR REPLACE TYPE BODY CommonObj AS
-----------Set & get-----------
FINAL MAP MEMBER FUNCTION GetID RETURN NUMBER IS
BEGIN
RETURN nID;
END;
-----
FINAL MEMBER PROCEDURE SetID ( nIDParm IN NUMBER ) IS
BEGIN
nID := nIDParm;
END;
-----------testing-----------
FINAL MEMBER FUNCTION IsInitialised RETURN BOOLEAN IS
BEGIN
RETURN GetID() IS NOT NULL;
END;
END;
The CommonObj serves as a basic object type for other types, who need to use methods GetID(), and IsInitialised(). [There is plenty of them - a whole hierarchy]. For example they are created as follows:
CREATE OR REPLACE TYPE PolisasObj
UNDER COMMONOBJ
(
nPARD_VIEN_VER_ID NUMBER,
<....>
MEMBER PROCEDURE Init ( nIDParm IN NUMBER )
)
;
The problem is that if I want to modify (add one more method or instance variable) the CommonObj, I get the error while recompiling:
ORA-02303: cannot drop or replace a type with type or table dependents.
I find it very annoying, as I have to go through all the type hierarchy and make all subtypes not to use CommonObj.
Help please, is there any easier way of doing that?
Like in Java, I can modify any superclass I want...
[Updated on: Thu, 03 January 2008 06:11] Report message to a moderator
|
|
|
|
|