In dealing with a performance issue on objects attached to a
document, I came up with an approach to create a subclass of
BaseObject that has its own Hibernate mapping, and can include other
full-class Java objects as children, etc.
This works pretty well but requires some hacking in that it doesn' t
seem like XWiki will load a subclass of BaseObject directly, so I
have to force this reloading when I access the object.
The main advantage is this allows me to have properties that are
loaded in one SQL roundtrip, as opposed to one SQL query per actual
object instance, which is the best that seems possible with the built-
in custom mappings.
I'm wondering if there it would make sense to incorporate this kind
of custom subclassing into the XWiki base code. I think it could be
done without a lot of work (when the store reads the object's class,
if it is a subclass of BaseObject it reloads that particular object
using the appropriate mappings).
For our own project we can probably do this with local patches, but
it seems like it might be useful to others.