openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "roger.keays" <>
Subject Re: Shared classloader and subclasses
Date Wed, 21 Mar 2007 23:28:31 GMT

Abe White wrote:
>> In the case above, another webapp has loaded the forums module,  
>> causing this
>> webapp to look for the mappings in that module even though they aren't
>> available.
>> I had difficulty trying to figure out how to restrict which  
>> subclasses are
>> 'seen'. Ideally I think it'd be done in the  
>> MetaDataRepository#register()
>> method, but no metadata seems to be available at this time.
> 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?


View this message in context:
Sent from the open-jpa-dev mailing list archive at

View raw message