I see. Here's a proposal: in the MetaDataRepository's implementation
of the RegisterClassListener interface, the repository only registers
the given class if either the user has not specified a persistent
types list (which we allow and in which case we attempt to lazily
discover persistent types), or if the class name appears in the
list. That way if you follow JPA guidelines and specify your
persistent class list properly, subclasses left off the list won't
even get registered with the metadata repository.
That sounds about right. I tried something similar using
MetaDataFactory.getPersistentTypeNames(), but this method requires a
classloader to be passed to it. Using the thread's classloader
didn't seem
right (and didn't work anyway). Is there another way to find this
list?
Good point. I guess we can't exclude the classes in the register
class listener method itself, but we can do so when we
processRegisteredClasses(). This method is only ever called from
places where we have the proper classloader (the same one we pass to
getPersistentTypeNames()).
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.