Hi David,

> 
> Hi all
> i've been looking through the tutorials to do inheritance 
> mapping of a 
> whole inheritance tree in a single table
> and i've seen that it is _required_ to have a field in the 
> objects that 
> contains the class name ...

It's not really required, as you are free to implement your own mechanism
and plug it into OJB. (See tutorial3.html for details)

> why is it so ?
> shouldn't it be possible to tell OJB to call 
> getClass().getName() on its 
> own for the FieldDescriptor storing the instance type in db ?
> has somebody thought a solution for this (e.g. write a 
> PersistentField 
> implemenation that can do it) ?

The problem is not so much storing of object but reloading from the db.
How can we know what concrete type is to be instantiated on loadinga certain
row from the database?
There must be a flag for each row that tells OJB which concrete type is to
be used for instantiation of a new object.

You can either use the OJB default mechanism or implement your own type
selection mechanism.

cheers,
Thomas

> Thanks for your time
> 
> David
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 
> 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to