----- Original Message -----
From: Jeff Prickett <[EMAIL PROTECTED]>
To: Turbine <[EMAIL PROTECTED]>; Turbine
<[EMAIL PROTECTED]>
Sent: Sunday, December 12, 1999 5:16 PM
Subject: Re: OR relationships
> Scott,
> I have some code that works which i can donate and work into the
framework.
> Would you like some help?
Absolutly! the more the better... got any other friends/colleagues willing
to help too? ; )
>
> How are you planning on handling inheritance? One table per concrete
class?
> One table per class? or the very unweidly one table for all objects?
>
well... as far as i know... the ClassMap class hierarchy's "job" is to
create a layer of abstraction between the database and the client
application. what this does is both the data schema and the client
application can change indepently of each other. therefor, the question of
how to handel inheritance becomes a non-issue. this allows the DBA to design
the data schema without restriction, and the same goes for the OO designers
who can design the OO aplication wihout reguard to how the object's data
gets "mapped" into the database. this also adds the ability to use a legacy
data schema that can not be changed because of other applications that are
dependent on it.
have you gotten the source from CVS yet? when you do take a look at two
classes: the testSQL calss and the EmployeeClassMap class. when you execute
the testSQL class its output will look like this:
SELECT
Employee.EMP_LNAME, Customer.EMP_FNAME, Address.EMP_ADDR1
FROM
Employee, Customer, Address
WHERE
Employee.EMP_LNAME = 'Scott' AND
Employee.EMP_ID = Customer.EMP_ID AND
Customer.EMP_ID = Address.EMP_ID OR
Employee.EMP_FNAME = 'Linda' AND
Employee.EMP_ID >= '800' AND
Employee.EMP_ID < '1245' AND
Employee.EMP_ID <= 1245 AND
Employee.EMP_LNAME LIKE 'Tavar%' OR
Employee.EMP_FULLNAME LIKE 'Barry W%' AND
Employee.EMP_ID = '425' AND
Employee.EMP_ID <= 1245
i know that this select statement does not make logical sence but i use it
to make a point. looking at this statement, say that the DBA desided to move
the Customer.EMP_FNAME field into the Employee table. The only thing that
will need to be changed is the EmployeeClassMap by changing the TableMap of
the ColumnMap... so the line:
employeeFirstNameColumnMap.setTableMap(customerTableMap);
will get changed to:
employeeFirstNameColumnMap.setTableMap(employeeTableMap);
which will change the select statement to this:
SELECT
Employee.EMP_LNAME, Employee.EMP_FNAME, Address.EMP_ADDR1
FROM
Employee, Address
WHERE
Employee.EMP_LNAME = 'Scott' AND
Employee.EMP_ID = Customer.EMP_ID AND
Customer.EMP_ID = Address.EMP_ID OR
Employee.EMP_FNAME = 'Linda' AND
Employee.EMP_ID >= '800' AND
Employee.EMP_ID < '1245' AND
Employee.EMP_ID <= 1245 AND
Employee.EMP_LNAME LIKE 'Tavar%' OR
Employee.EMP_FULLNAME LIKE 'Barry W%' AND
Employee.EMP_ID = '425' AND
Employee.EMP_ID <= 1245
see how the qualification of the EMP_FNAME changed from "Customer" to
"Employee" and the list of tables in the from cluase no longer has
"Customer" table in it?
> I have read Scott Amblers white paper and would love to work with you to
> make the object persistence layer a reality. I will be emailing the list
> again tomorrow with a link to my code.
>
great...
-scott-
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]