AW: [OJB-developers] n:m relations to polymorph classes, automati c ddl generation
Brought to you by:
thma
From: Mahler T. <tho...@it...> - 2002-03-25 14:23:58
|
Hi Cristoph, > Hi All! > > I am evaluation ojb for a simple content management system > that supports > multiple article types. Each article will be saved in a > separate table, > but i want to search across all of them. I think the > <extends> feature > of ojb enables that. Right! > But I also have a categories table with a n:m relation to article. > now my questions: > Is it possible to have a n:m relationship to a base class? Yes! > I assume that ojb joins all involved tables when doing a query on an > interface or baseclass. Will that still work if I have really lots of > different article types? No, we are not joining accross all involved tables. Thus there should be no problems for your scenario. > > Some other questions relating to my cms efforts: > Is there support planned for automatic updating of the > database scheme? > (ie create table or alter table) OJB does have a reverse engineering feature (you can read in RDBMS tables an have Java classes and an XML repository generated). But currently there is no forward engineering (from Java Object model to XML repositoty and RDBMS table) implemented. IMHO automatic schema generation is possible but to define a semantics that fits all needs will be difficult. We have no plans in this directions yet. > How hard would it be to use ojb without generating a class for every > table? Depends on your ER model. > I'd just like to use ojb for generating a query, but i want to > get my data back in a map instead of a bean. OJB provides Report queries, that allow exactly this. > Then I could > just define an > article as a ojb mapping, and dont need to generate and compile java > code if a new articletype is generated. > Dynamic generation of classes and respective mappings is somewhat problematic in languages like Java. IMO Using Smalltalk would be much simpler for such problems. HTH, Thomas |