Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

ADD SUPERCLASS Clause

Description

To extend class inheritance, add a super class to a class. A relationship between two classes is created when a super class is added to an existing class. Adding a super class does not mean adding a new class.

Syntax

ALTER CLASS

.

.

.

ADD SUPERCLASS [ user_name.]class_name [ { , [ user_name.]class_name }_ ]

[ INHERIT resolution [ {, resolution }_ ] ] [ ; ]

resolution:

{ column_name | method_name } OF superclass_name [ AS alias ]

For the first class_name, specify the name of the class where a super class is to be added. Attributes and methods of the super class can be inherited by using the syntax above.

Name conflicts can occur when adding a new super class. If a name conflict cannot be resolved by the database system, attributes or methods to inherit from the super class can be specified by using the INHERIT clause. You can use aliases to inherit all attributes or methods that cause the conflict. For details on super class name conflicts, see the Resolving Class Conflict section.

Example

The following example shows how to create the female_event class by inheriting the event class included in demodb.

CREATE CLASS female_event UNDER event;