[Modeling-users] Re: Implementing inheritance through vertical mapping
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-09-25 13:38:06
|
Federico Heinz <fh...@vi...> wrote: > Modeling does not implement vertical mapping yet, a feature we might[1] > be willing to contribute. However, from the looks of it, the XML schema > definition does not provide the needed information for it: the way it's > structured, it doesn't contain any provisions for telling the system > that a given class takes its data from a series of tables and not just > from one. Agreed. > This can, of course, be corrected, and instantiating an object from > several tables at once was one of those things EOF did beautifully > (maybe still does). I did not check, but I can't see a reason why it would have been removed, even now that it's now completely rewritten in Java :) > But the XML schema definition must be changed, > hopefully in a backwards-compatible way. Are there any plans about how > these changes could be implemented? We could suggest ways for doing it, > but if the issue has been discussed, we'd rather add our salt to the > discussion than make complete fools of ourselves :-) I can't remember if it's been discussed here, however this is the way I think this could be done: - models: add support for flattened attributes and relationships. Flattened properties are exactly this: take the value for a given field from another entity (hence potentially from another table). Flattened properties will be declared with a simple path, such as: toEmployee.toStore.name (BTW, backward-compatibility should, and will, be ensured) - make the framework correctly handle those flattened properties. As far as I can see, this would only impact the low-level bricks of the framework (esp. SQL generation for fetching and saving). If you have different ideas, techniques, suggestions, etc., please tell; my point of view is, for sure, greatly influenced by my remembrance of past EOF-practices ;) and history has already shown that my eyes and brain sometimes need to be forced to be kept opened (Mario can tell, he who fought my initial doubts for PyModels!) > [1] depending on priorities. We have done similar work in other > contexts, but for now we could choose to use PostgreSQL's inheritance > mechanism to implement the database, until we can spare the time to > create the vertical mapping layer. Could you possibly elaborate on that? I never played with postgresql's inheritance support, and it's probably something that could be added in the User's Guide until vertical mapping is supported. If you find some time to illustrate the mechanisms, I'll be interested in learning how they behave wrt. the framework. -- S=E9bastien. |