Re: OO -> RDBMS mapping
| From: | Andi Gutmans | Date: | Fri, 01 Nov 2002 10:06:52 +0000 |
| Subject: | Re: OO -> RDBMS mapping | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-10410@lists.php.net to get a copy of this message | ||
At 05:46 PM 11/1/2002 +0800, Alan Knowles wrote:
Andi Gutmans wrote:There are a few ways of doing this mapping. If you want performance than you can map the whole hierarchy to the same table. If you want to save space you can map each class to a separate table and use a join. There are also some other ways.Hmm I'm not quite sure.JDO includes mapping of class hierarchies to RDBMS,not sure how that would work - can you give an example? (or url) .. dataobjects forces you to make a class for each table, - so making one class extend another table... should be possible.
Object query language :) If you're mapping objects to databases you need someway of retrieving the object. You can find an example of an OQL query here http://www.javaworld.com/javaworld/jw-04-2002/jw-0412-jdo.html. It is usually translated by the JDO driver to SQL.transaction management (including locking)this could be added, without too much work.. (seems like a good addition)and OQL,mmh, thats a new abbreviation to me :)
I found an interesting link. Apparently someone has already started working on this. I'm not quite sure how good/complete the implementation is http://www.mrjoy.com/easyorm.shtml. It'd also be nice for him to have support for optimistic locking. Andia simple query language pretty much the most simple parts of SQL in order to retrieve the objects you want to work on.Thats sounds like quite an overhead.. - both for the class and the user (to learn).. just letting them do raw SQL $object->query().. kind of solves that. (although it obviously has the catch of breaking the database independance)