Is it possible to map a class twice?
I've written a class that basically wraps a HashMap to provide some other functionality. The class has no other values that need to be persisted. I've used this class in a couple of places as a collection to hold different objects. In other words, in one place, I use MyMap class to hold a bunch of A objects, while in another place it holds B objects - with no relationship at all between the A and B classes.
I can write a mapping file to map one use of the class - to hold As, for instance. Is there a way to have a mapping for each of these uses?
Is a UserType more appropriate? If so, can someone point me to a good tutorial/documentation for writing a UserType for a Map?
Many thanks,
Scott
|