On 10/25/05, Bernd Laengerich <[EMAIL PROTECTED]> wrote: > Hi, > > is there any way to tell OJB to use a different attribute name for a > specific class instead of ojbConcreteClass? > > The problem is, I have a table A with objects of two different classes > A und B (both using inheritance) instantiated from it. > > Torque refuses the "datasql" target with the error: > Attribute "OjbConcreteClass" was already specified for element "ATABLE". > OJB itself is working fine with it.
I think the error comes from the XDoclet module, not from Torque. The problem is that you should not redefine the field in the subclass (you don't have to, anyway, as its protected and thus already visible in the subclass), because when using reflection there is no guarantee which one (of the base class or the sub class) is used. The usual pattern is to define the field in the base class, and initialize it either directly on in the constructor, like so: private String ojbConcreteClass = getClass(); Btw, this way you don't even have to make it protected as the subclasses don't do much with it anyway. Tom --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]