This project is read-only.

How does inheritance work with Opf3?

Mar 21, 2010 at 9:28 AM

Hi,

I have in my database inheritance relationship, like Teacher, Student -> Person. The SQL statements are:

CREATE TABLE Person (ID int IDENTITY NOT NULL, FirstName varchar(255) NOT NULL, LastName varchar(255) NOT NULL, Email varchar(255) NOT NULL, ..., PRIMARY KEY (ID));

CREATE TABLE Teacher (PersonID int NOT NULL, BookingID int NULL, DepartmentID int NOT NULL, PRIMARY KEY (PersonID));

CREATE TABLE Student (PersonID int NOT NULL, StudentId int NOT NULL, StudentClassID int NOT NULL, PRIMARY KEY (PersonID));

ALTER TABLE Teacher ADD CONSTRAINT [teacher-is-a-person] FOREIGN KEY (PersonID) REFERENCES Person (ID);

ALTER TABLE Student ADD CONSTRAINT [student-is-a-person] FOREIGN KEY (PersonID) REFERENCES Person (ID);

In C# code that would be a base class Person with two child classes Teacher and Student.

How do I map this with Opf3?

Mar 21, 2010 at 7:02 PM

Just realized there is a video for that. I guess for people who don't like to have easy copy&paste text or for people who can't read at all.

In addition, it's in a WMV format with neither ffmpeg nor VLC can open.

So I can't watch it at all. Thank you very much.

Apr 1, 2010 at 6:42 PM

I'm too lazy to rewrite what I've already done here. Take a look and let me know if you need more help.