On 10 août 2010, at 18:16, Rick Curtis wrote:

>> bin is managed by Eclipse : src/META-INF should be OK if I manage to have
> only one persistence.xml file.
> Correct. Eclipse will automatically move src/META-INF to bin.
> 
>> Very good idea, but how to tell openjpac with persistence unit to use ??
> I think you can try something like "-p #[pu_name]". ... I'm not sure how
> nicely that'll play with the eclipse ant configuration, but you should be
> able to get it to work.
> 
> http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_conf_devtools
> 

I don't find the answer in the doc nor in the source code of PCEnhancerTask.
Basically, I'm not able to choose the persistence unit from ant task for the 
build-time enhancer.

The "-p #[pu_name]" stuff is from the command line, not from ant.

Exploring the source code of PCEnhancerTask doesn't helped me.
I'm not sure but it might confirmed it is just not possible :

    protected ConfigurationImpl newConfiguration() {
        return new OpenJPAConfigurationImpl();
    }

No persistence unit as a parameter ?
On the other hand, this method doesn't appears to be called :
What is that getConfiguration() method ?
Can't find it in the class, so it must be from superclass witch is from Ant, so 
no possibility to pass the persistence unit ?

    protected void executeOn(String[] files)
        throws IOException {
        flags.directory = (dirName == null) ? null
            : Files.getFile(dirName, getClassLoader());
        OpenJPAConfiguration conf = (OpenJPAConfiguration) getConfiguration();
        MetaDataRepository repos = conf.newMetaDataRepositoryInstance();
        PCEnhancer.run(conf, files, flags, repos, null, getClassLoader ());
        }

Any idea ? I'm totally in the dark ...

Reply via email to