openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Spiro" <m.sp...@dcs-caesar.de>
Subject AW: Enhancement with multiple persistence units
Date Tue, 17 Jan 2012 17:40:59 GMT
I'm using the PCEnhancerTask with Ant and OpenJPA version 2.1.0. This line:

        PersistenceUnitInfoImpl pinfo = parseResources(parser, urls, name,
loader);

(Class PersistenceProductDerivation , line 525) seems to be the point where
it begins to go wrong. This following method (beginning in the line 554)
generates an internal list of all persistence units, but returns only one of
them losing information about the rest:

    private PersistenceUnitInfoImpl parseResources(ConfigurationParser
parser,
        List<URL> urls, String name, ClassLoader loader)
        throws IOException {
        List<PersistenceUnitInfoImpl> pinfos = new
ArrayList<PersistenceUnitInfoImpl>();
        for (URL url : urls) {
            parser.parse(url);
            pinfos.addAll((List<PersistenceUnitInfoImpl>)
parser.getResults());
        }
        return findUnit(pinfos, name, loader);
    }

It's OK if the persistence unit name is specified, but if it is not
specified, then only the classes from this single returned persistence unit
are enhanced and the rest is not.


Kind regards,
Michael Spiro


> -----Urspr√ľngliche Nachricht-----
> Von: Pinaki Poddar [mailto:ppoddar@apache.org]
> Gesendet: Dienstag, 17. Januar 2012 15:57
> An: dev@openjpa.apache.org
> Betreff: Re: Enhancement with multiple persistence units
> 
> Hi,
> 
> Enhancer seems to run on all units when it was invoked as
> 
> $ java org.apache.openjpa.enhance.PCEnhancer -p META-
> INF/persistence.xml
> 
> If you are running by a Ant/Maven script, prefer invoking the java
> class (
> i.e. org.apache.openjpa.enhance.PCEnhancer) directly instead of the Ant
> task
> defined by OpenJPA. Runs much cleaner.
> 
> what exactly is not working currently?
> 
> -----
> Pinaki Poddar
> Chair, Apache OpenJPA Project
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/Enhancement-with-multiple-
> persistence-units-tp7183611p7196631.html
> Sent from the OpenJPA Developers mailing list archive at Nabble.com.


Mime
View raw message