1

I successfully created an EmployeeType in Oracle 11g with the following atrributes;

emp_id   VARCHAR2(5)
title   VARCHAR(15)
firstname VARCHAR(20)
surname   VARCHAR(20)
address Addresstype
tel_no  ARRAY(3) of VARCHAR(15)
get_address() VARCHAR2()

and was told to create DepartmentType in Oracle 11g with the following attributes

dept_id  VARCHAR2(3)
location AddressType
manager  REF Employee

but my problem now is I don't know how to use the object-relational REF construct to define object-references between the two tables for relating Departments to Employees so that I can create table which will store department details and insert rows.

4

1 回答 1

2

您可以使用一些 ORM(对象关系映射)框架,您可以在此处阅读

什么是对象关系映射框架?

这是一个很大的话题,或者您可以设法自己找到一种方法,但是您必须知道,关系数据库只是带有数据的行,与面向对象的对象无关,您可以将其作为一种方法存储数据。

我希望这有帮助。

于 2013-02-22T23:41:38.993 回答