You could consider changing your design to use delegation rather than inheritance. Let's say you have class A that contains all the data and subclasses A1 through A30 that contain the different behavior. You could move the data to class B and have class A hold on to an instance of class B. So in the code for A1 through A30, your code would change from this.getName() to this.getB().getName(). Or you could duplicate all the getters from B in A, so your subclasses wouldn't change at all. That way you'd only have 1 class descriptor. Just a thought :-)
Greg -----Original Message----- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Friday, October 31, 2003 1:48 PM To: OJB Users List Subject: Re: mapping many classes to one table hi, Robert J Celestino wrote: > David, > > I believe that you must write 30 class descriptors all exactly the > same except for the class name :-( I have not been able to get this sort of scenario to work any other way. > > It seems odd, since ojb "should" know the inheritance structure due to > the extent-class tag. It would be nice if extent classes need only add field-descriptors for the attributes that are different. > the problem is that descriptors are not inherited by extent class. jakob > Bob c > > ---------------------------------------------------------------- > Bob Celestino > SAS Research and Development > 919 - 531 - 9425 > [EMAIL PROTECTED] > > SAS - The Power to Know > > > > -----Original Message----- > > From: David Corbin [mailto:[EMAIL PROTECTED] > > Sent: Friday, October 31, 2003 2:37 PM > > To: OJB Users List; Jakob Braeuchi > > Subject: Re: mapping many classes to one table > > > > > > On Friday 31 October 2003 14:11, Jakob Braeuchi wrote: > > > hi david, > > > > > > > > why don't you use ojbConcreteClass ? > > > > I don't understand. I fully plan on having something like > > this so I can > > materialize the correct type object. That has little (as > > far as I can tell) > > to do with my problem. As far as I can tell, unless I write 30 > > class-descriptors, those objects of that class are believe > > to not be > > persistable. > > > > > > > > > > David Corbin wrote: > > > > I have a class heirarchy, and there are 30 different concrete > > > > classes in it. There is NO difference in the data, just > > in behavior. > > > > I'm well aware of how to read these in from a common > > table using a > > > > RowReader. > > > > > > > > Do I have to write 30 class-descriptors all of which > > look exactly > > > > the same except for the class name? > > > > > > yes, if you do not want to copy paste ;) > > > > > > jakob > > > > > > > Thanks > > > > > > > > ------------------------------------------------------------ > > --------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > -- > > David Corbin <[EMAIL PROTECTED]> > > > > ------------------------------------------------------------ > > --------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
