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 < [email protected]> 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
