db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "TINE Houari (OBJECTIVA)" <houari.t...@ca-cedicam.fr>
Subject RE: inheritance, extent and cleaner reference
Date Thu, 20 Mar 2003 09:20:21 GMT

Ab <<org.jar>> out improvements about anonymous fields, it seems the file
isn't attached.

Here it is.

Houar TINE

 -----Message d'origine-----
De : 	Thomas Mahler [mailto:thma32@web.de] 
Envoyé :	dimanche 16 mars 2003 11:10
À :	OJB Developers List
Objet :	Re: inheritance, extent and cleaner reference

Hi all,

Jakob Braeuchi wrote:
> hi,
> 
> i like the idea of 'anonymous' fields but imo we should no longer stick 
> to field-ids.

I agree!

> i propose to have some kind of  fielddescriptor that does not  need a 
> field in the object. may be it should be named column-descriptor.
> 
> <class-descriptor class="A" table="TABLE_A">
>    <field-descriptor name="id" column="ID" jdbc-type="INTEGER"
> primarykey="true" autoincrement="true" />
>    <column-descriptor name="id_b" column="ID_B" jdbc-type="INTEGER"
> />
>    <reference-descriptor name="refB" class-ref="B" auto-update="true">
>        <foreignkey field-ref="id_b" />
>    </reference-descriptor>
> </class-descriptor>
> 
> what do think ?

makes a lot of sense to me!

Thomas

> jakob
> 
> Thomas Mahler wrote:
> 
>> Hi Houar TINE,
>>
>> All three feature sound like real improvements.
>> Especially 1. and 2. have been requested several times by users. It 
>> would be great to integrate your stuff into the codebase!
>>
>> Just post it to the list, we will review it!
>>
>> thanks for your contribution,
>> Thomas
>>
>>
>> TINE Houari (OBJECTIVA) wrote:
>>
>>> Hi,
>>>
>>> I finished ameliorations of OJB that consist of
>>> 1. eliminating fk from 1-1 reference between objects.
>>> 2. implement inheritance as 1-1 reference.
>>> 3. eliminating the obligation of declaring the attribute 
>>> ojbConcreteClass in
>>> extent class.
>>>
>>> The idea consists of introducing the concept of anonymous field 
>>> descriptor
>>> and anonymous persitent field.
>>>
>>> case1: A reference B through a 1-1 relation
>>> class A {
>>>   int id;
>>>   B refB;
>>> }
>>>
>>> class B {
>>>   int id;
>>>   String attribute;
>>> }
>>>
>>> Class descriptor for A will be declared like this:
>>>
>>> <class-descriptor class="A" table="TABLE_A">
>>>     <field-descriptor id="1" name="id" column="ID" jdbc-type="INTEGER"
>>> primarykey="true" autoincrement="true" />
>>>     <field-descriptor id="2" name="" column="ID_B" jdbc-type="INTEGER"
>>> />
>>>     <reference-descriptor name="refB" class-ref="B" auto-update="true">
>>>         <foreignkey field-id-ref="2" />
>>>     </reference-descriptor>
>>> </class-descriptor>
>>>
>>> NOTICE that the name of field 2 is "".
>>> -----------------------------------
>>>
>>> Amelioration allow to handle referenced object B without having a fk 
>>> in A.
>>>
>>> Case 2: X inherits from Y
>>> class Y {
>>>   int id;
>>>   String AttributeY;
>>> }
>>>
>>> class X extends Y {
>>>   String AttributeX;
>>> }
>>>
>>> Class descriptor for X will be declared like this:
>>>
>>> <class-descriptor class="X" table="TABLE_X">
>>>     <field-descriptor id="1" name="id" column="ID" jdbc-type="INTEGER"
>>> primarykey="true" autoincrement="true" />
>>>     <field-descriptor id="2" name="" column="ID_Y" jdbc-type="INTEGER"
>>> />
>>>     <reference-descriptor name="" class-ref="B" auto-update="true">
>>>         <foreignkey field-id-ref="2" />
>>>     </reference-descriptor>
>>> </class-descriptor>
>>>
>>> NOTICE that the name of field 2 is "" and the name of 
>>> reference-descriptor
>>> is ""
>>>
----------------------------------------------------------------------------

>>>
>>> ----
>>>
>>> Amelioration allow to handle base object Y as a reference-descriptor.
>>>
>>>
>>> Case3: extent
>>>
>>> abstract class U {
>>>   int id;
>>> }
>>>
>>> class V extends U {
>>>   ...
>>> }
>>>
>>> class W extends U {
>>>   ...
>>> }
>>>
>>> The class descriptor is not changed but the amelioration don't need an
>>> attribute ojbConcreteClass to handle objects.
>>>
>>>
>>> How it works:
>>> I have introduced   - AnonymousFieldDescriptor,
>>>   - AnonymousPersistendField,
>>>   - AnonymousPersistendFieldForInheritance,
>>>   - AnonymousObjectReferenceDescriptor,
>>>   - AnonymousFKValue and
>>>   - AnonymousObjConcreteClassValue
>>>
>>> and some modifications in the class RepositoryXmlHandler. That's all.
>>>
>>> What do you think.
>>>
>>> Houar TINE
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message