I have looked at all of the examples, I can't seem to make heads or tails of how to handle my situation. I want to map a class that has a reference to an object, that can one of many different objects, that all implement the same interface.

Example

Interface A{

}

class B implements A
{}

class C implements A
{}

class Z
{
        private A myA;
}

So, in this case, how do I map class Z since it's member variable is of Type A, but I want the concrete object, either of Type B or C to be filled in.

Seems like there is no known strategy to do this: "Using Interfaces With OJB" talks about a similar situation, but assumes that there is only one concrete class that can be instantiated for the reference (the factory-method assumes that it will only return one concrete class type).

Seems like I need a combination of the Interface mapping, and the 'ojbConcreteClass' property to have the appropriate concrete class instantiated.

Thoughts? What am I missing?

-Andrew


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



Reply via email to