db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Anthony <charles.anth...@hpdsoftware.com>
Subject RE: Proposal to get rid of ojbConcreteClass
Date Sat, 07 Aug 2004 13:03:14 GMT
For What It's Work - So long as we can retain the current ojbConcreteClass
behaviour (by including the same old field-descriptor, pointing a new
concrete-selector at it, and defaulting the value to the classname), I have
no objections and it seems to be a good idea. 

Cheers,

Charles.

> -----Original Message-----
> From: Jakob Braeuchi [mailto:jbraeuchi@gmx.ch]
> Sent: 07 August 2004 13:24
> To: OJB Developers List; Armin Waibel; Andrew.Clute@osn.state.oh.us
> Subject: Proposal to get rid of ojbConcreteClass
> 
> 
> hi all,
> 
> i think we need a more flexible approach when mapping 
> multiple classes to one 
> single table. today we have the field-descriptor 
> 'ojbConcreteClass', a working 
> solution i have to admit.
> the biggest problem is imo that we always store the name of 
> the class in the 
> database. this makes refactoring of the package structure 
> unnecessarily 
> difficult. another, but minor issue, is that ojbConcreteClass 
> is an ordinary 
> field-descriptor.
> 
> i propose to add some kind of concrete-selector to the 
> class-descriptor. this 
> selector points to an ordinary field-descriptor. additionaly 
> the selector may 
> have a value that is stored instead of the real class name. 
> if no selector-value 
> is defined we could still use the class name as default:
> 
> <class-descriptor
> 	class="org.apache.ojb.broker.ObjectRepository$A"
> 	table="AB_TABLE"
> 	selector-field-ref="my_conrete_class"	
> 	selector-field-value="class_a"	
>  >
> 	<field-descriptor
>           name="id"
>           column="ID"
>           jdbc-type="INTEGER"
>           primarykey="true"
>           autoincrement="true"
>         	/>
>         	<field-descriptor
>           name="my_conrete_class"
>           column="CLASS_NAME"
>           jdbc-type="VARCHAR"
>         	/>
> 	...
> </class-descriptor>
> 
> as an alternative the selector could also be defined using a 
> special element:
> 
> <class-descriptor
> 	class="org.apache.ojb.broker.ObjectRepository$A"
> 	table="AB_TABLE"
>  >
> 	<selector-descriptor
> 	 field-ref="my_conrete_class"	
> 	 value="class_a"	
> 	/>
> 
> 	<field-descriptor
>           name="id"
>           column="ID"
>           jdbc-type="INTEGER"
>           primarykey="true"
>           autoincrement="true"
>         	/>
>         	<field-descriptor
>           name="my_conrete_class"
>           column="CLASS_NAME"
>           jdbc-type="VARCHAR"
>         	/>
> 	...
>   </class-descriptor>
> 
> there's another proposal by andrew clute to include a 
> class-selector in the 
> reference-descriptor:
> 
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=ojb-dev@db
.apache.org&msgNo=7861

actually this does not address the same problem, but we should make sure
that 
the naming is consistent.

what do you think ?

jakob


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



___________________________________________________________
HPD Software Ltd. - Helping Business Finance Business
Email terms and conditions: www.hpdsoftware.com/disclaimer 



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


Mime
View raw message