Here is one class that Implements the AbstractFactory
So in the server side I create one of these and put it into a Map that I return to the client. The Map key is the DiscountTypeLookup.class and the value is the lookup object within the AbstractLoopkup.
When I get it on the client it is seeing that the DiscountTypeLookup class has the loadData method with code, which include Hibernate classes.
Even though I can never call the loadData method on the client, since we use the Class jsut to get the value out, in which the value class is of Type Lookup, which implements the ILookup interface. So the client gets the value out and assigns it to a reference of type ILookup, and that is all it can call methods on, is methods defined in that interface.
OK here is my problem, it is giving me a ClassDefNotFound exception on the Hibernate classes on the client. These classes are not on the client and should not be.
Instead of using the DiscountTypeLookup.class as the key I am using the RetailDiscount.class.getName() instead. So I use the String value of the DTOs class name.