Summary


In this chapter, you learned that

  • The Oracle database allows you to create object types. An object type is like a class in Java.

  • An object type may contain attributes and methods .

  • A simple example of an object type would be a type that models a product. This object type could contain attributes for the product s name , description, and price, along with a method that gets the sell-by date of the product.

  • You create an object type using the CREATE TYPE statement.

  • You can use an object type to define a column in a table, and the column is known as a column object.

  • You can also use an object type to define an entire table, and the table is known as an object table.

  • You use object references to model relationships between object tables, rather than foreign keys. Object references are defined using the REF type and are basically pointers to objects in an object table. Each object in an object table has a unique object identifier (OID) that you can then store in a REF column.

  • With the release of the Oracle9 i database, you can use object type inheritance. This allows you to define hierarchies of database types.

  • You can mark an object type as NOT INSTANTIABLE , which prevents objects of that type from being created. You might want to mark an object type as NOT INSTANTIABLE when you want to use that type as a supertype .

  • You can define your own constructors.

In the next chapter, you ll learn about collections.




Oracle Database 10g SQL
Oracle Database 10g SQL (Osborne ORACLE Press Series)
ISBN: 0072229810
EAN: 2147483647
Year: 2004
Pages: 217

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net