openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <d...@iq80.com>
Subject Re: Generation of entity classes
Date Mon, 01 Jan 2007 21:52:22 GMT
I think it only works if you preehnahce.  The runtime enhancer will  
only modify on classes with metadata loaded, and the metadata seems  
to only be cached at startup.

-dain

On Jan 1, 2007, at 2:36 AM, Patrick Linskey wrote:

> Generally-speaking, you should be able to bootstrap new classes into
> OpenJPA over time. There are some situations that will prevent this
> (i.e., if exclude-unlisted-classes is set to true, and possibly some
> automatic class-scanning modes).
>
> -Patrick
>
> -- 
> Patrick Linskey
> BEA Systems, Inc.
>
> ______________________________________________________________________ 
> _
> 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.
>
>> -----Original Message-----
>> From: Dain Sundstrom [mailto:dain@iq80.com]
>> Sent: Sunday, December 31, 2006 9:19 PM
>> To: open-jpa-dev@incubator.apache.org
>> Subject: Re: Generation of entity classes
>>
>> Actually, never mind.  Due to the interconnectedness of persistent
>> classes (i.e., relationships), I need to generate all the classes at
>> once and add them all to the class loader at the same time.  This
>> means my "elegant" solution is just broken :)
>>
>> -dain
>>
>> On Dec 31, 2006, at 3:12 PM, Dain Sundstrom wrote:
>>
>>> I working on an implementation of the EJB cmp specification which
>>> uses JPA under the covers to implement the persistence.  I
>> have the
>>> basics working with hand written subclasses of the abstract cmp2
>>> beans.  I just wrote a code generator to replace my hand coded
>>> subclasses using ASM (which rocks), and I am having problems
>>> getting OpenJPA to enhance my generated class.  It appears that at
>>> the moment I construct the EMF all entity classes must be
>> available
>>> via the temp class loader.  If they are not, OpenJPA will not add
>>> an entry into the MetaData repository.  Later when I generate my
>>> class and load it, the OpenJPA transformer looks for the MetaData
>>> in the repository, doesn't find it, and completely skips
>>> enhancement (PCEnhancer line 322).  It is possible to have the
>>> enhancer fault load the metadata and continue with enhancement?
>>>
>>> In the mean time, I'm going to hack OpenEJB to kick off generation
>>> very early in deployment, but it would be much more elegant
>> to wait
>>> until the EJB is deployed to generate the classes and this happens
>>> after JPA is initialized.
>>>
>>> Thanks,
>>>
>>> -dain
>>
>>


Mime
View raw message