Yes, I try the # syntax without success from ant file.

Also, I have a persistence.xml file with several persistence uni,
enhance task do the job, no way to know witch one is used !

As explained in the "Enhance using Eclipse" thread, I digg into the code of 
PCIEnhancer without success too ...

I did 2 threads to separate questions : general enhance one and specific one 
trying to use ant in Eclipse.
It works but not optimized : no way to choose persistence unit, ...

On 12 août 2010, at 14:51, Michael Dick wrote:

> Just noticed your other thread. Looks like you tried the # persistence unit
> name option and that didn't work - I'd have to look into that.
> 
> I think most of the rest of what I wrote applies to the PCEnhancer command
> line tool and the ant task (e,g. you can specify classes or .java files).
> 
> -mike
> 
> On Thu, Aug 12, 2010 at 7:46 AM, Michael Dick <michael.d.d...@gmail.com>wrote:
> 
>> Hi,
>> 
>> I think you mean the command line PCEnhancer. If you're referring to one of
>> the other tools (Eclipse / Maven plugin) my answers probably aren't right.
>> 
>> On Thu, Aug 12, 2010 at 6:07 AM, Jean-Baptiste BRIAUD -- Novlog <
>> j-b.bri...@novlog.com> wrote:
>> 
>>> Hi,
>>> 
>>> I'm using Enhance for a while now, but still have questions :
>>> 
>>> * Why do enhance need persistence.xml, no DB connection should be done
>>> during enhance, right ?
>>> 
>> 
>> No DB connection is needed, but the list of persistent classes is used and
>> some other configuration options affect enhancement (e.g.
>> openjpa.DetachState). The tool could apply defaults if no persistence.xml
>> was found - but that can be a two edged sword.
>> 
>> 
>>> * Why enhance allow/need to specify .java files, only .class are enhance,
>>> and .class must be there before enhancement, right ?
>>> 
>> 
>> I think you can specify either the full name of a class, the .java file, or
>> the .class file per section 2.1 in the 
>> manual<http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_pc_enhance_build>(scroll
>>  down a bit - it's the fourth paragraph).
>> 
>> 
>>> * Why enhance allow/need to specify the files to enhance, aren't they
>>> already in the persistence.xml ?
>>> 
>> 
>> If you don't specify anything it will use the classes listed in
>> persistence.xml.
>> 
>> 
>>> * The complete total absolute list of possible option for the enhancer,
>>> especially the ant callable version.
>>> 
>> 
>> You're right. we could have better documentation for the ant tasks - we
>> have a skeleton in the manual, but the complete list of options requires
>> some source code diving.
>> 
>> 
>>> I just notice from
>>> http://www.ibm.com/developerworks/websphere/techjournal/0612_barcia/0612_barcia.html
>>> That the following option was possible :
>>> <openjpac>
>>>   <config propertiesFile="./META-INF/persistence.xml"/>
>>>   <fileset dir=".">
>>>   <include name="**/com/ibm/persistence/ejb3/order/entity/*.java" />
>>>   </fileset>
>>> </openjpac>
>> 
>> 
>>> So specifying the persistence.xml location is possible and it might be
>>> outside META-INF ?
>> 
>> So, specifying all the java (?) file to enhance is possible.
>>> 
>> 
>> That's definitely possible. There's a similar example in the manual 
>> here<http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_integration_enhance>.
>> 
>> 
>> Any other option (like the persistence unit to use) ?
>>> 
>> 
>> From memory you can use # followed by the persistence unit name to specify
>> the persistence unit. For example :
>> <config propertiesFile="/home/mikedd/enhancer/persistence.xml#myPUname"/>
>> 
>> 
>>> 
>>> Thanks !
>> 
>> 
>> 
>> Regards,
>> -mike
>> 

Reply via email to