AW: [Objectbridge-developers] Re: OJB Technical Questions & Tutor ial #3
Brought to you by:
thma
From: Mahler T. <tho...@it...> - 2001-05-23 07:17:02
|
> -----Urspr=FCngliche Nachricht----- > Von: Christian Sell [mailto:chr...@ne...] > Gesendet: Mittwoch, 23. Mai 2001 00:33 > An: obj...@li... > Betreff: [Objectbridge-developers] Re: OJB Technical Questions & > Tutorial #3 >=20 >=20 > Hello, >=20 > Hope you dont mind that I throw in my few cents here: >=20 > > > SUPPORT FOR MAPPING MANY-MANY RELATIONSHIPS > > > Does OJB currently support the mapping of many-to-many > > > relationships? I > > > didn't see any examples in the tests. If not, is this=20 > planned for an > > > upcoming release? > > > > > You are right, there is no support for m-n relationships.=20 > You have to > > decompose it into two 1-n relationships. You have to do=20 > this for your > RDBMS > > ER model anyway, so its not such a big problem in my eyes. > > There are some OJB users (marquier et al.) who are thinking=20 > of building an > > n-m extension. But right now there are no concrete plans to=20 > include such a > > feature. >=20 > I dont think the fact that in physical database modeling you=20 > decompose N-M > relationships into separate 1-N relationships makes this a less = useful > (should I say crucial?) feature fo an O/R modeling tool.=20 > After all, it is > the very purpose of the O/R tool to cover the technical=20 > details with a more > abstract and intuitive layer. And even if I was going to=20 > program plain SQL, > I would use a double join to directly access the final target=20 > entity and not > load the rows of the associative table and then proceed from there. >=20 Sure, covering M-N with an O/R tool is an important feature.=20 The current development on OJB is mostly concerned with basic infrastructure. (Implementing ODMG, building a distributed architecture) Things like - automated generation of proxy classes - automated support for M-N Relationships - automated generation of mapping data and DLL from java classes - automated reengineering of DDL to java classes and mapping data - XMI interface - GUI Mapping Workbench are useful things (that's why commercial tools like toplink have them). = But they only make sense when the basic infrastructure is stable.=20 Of course I have no objections if some volunteers start working on M-N = or the like :-) > > > ASSIGNING IDENTITY VALUES > > > Some of the object graphs that I will be persisting have > > > dependent/related > > > objects which do not have IDs. Do all objects have to=20 > have IDs when > > > persisting using OJB? If so, is there a way to have OJB=20 > transparently > > > assign IDs using the SequenceManager, without the client code > > > needing to > > > call SequenceManager.getUniqueId() for each object? If not, > > > can I use a > > > ConversionStrategy as a means of implementing transparent ID > > > assignment? > > > > I'm not sure if I get you right: Your database table have=20 > no primary key > > columns? Or do they have non numeric keys? Or do you have=20 > compound keys, > > that contain of two or more columns? > > > > OJB does require to have primary keys. But they can be of=20 > arbitrary type > > (not only INT) and may also be compound keys. >=20 > If I understand Sasha right, He is referring to what in E/R=20 > we used to call > identifying relationships. This is where one entity is=20 > dependent on another > in such a way that the foreign key becomes part of the=20 > primary key. If this > is a 1-1 relationship, there is even no need for an=20 > additional identifier, > therefore it should be sufficient to have a foreign key that=20 > also serves as > primary key (the primary key is "inherited" by the dependent=20 > entity. In > fact, if you implement inheritance on top of a relational=20 > model, this is > exactly where you end up, dont you?). It would be rather=20 > inconvenient IMO if > the dependent entity had to maintain an additional primary=20 > key just for the > sake of the O/R mapping tool. >=20 > thanks, and good night, > Christian >=20 Ah, OK, now I got it.=20 This of course possible. You just have to declare the foreign-key = attribute as primary key in the XML Mapping Repository. Thomas >=20 > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > http://lists.sourceforge.net/lists/listinfo/objectbridge-developers >=20 |