geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Quintin Beukes (JIRA)" <j...@apache.org>
Subject [jira] Updated: (GERONIMO-4928) In the JPA persistence.xml loading code, exclude-unlisted-classes handling not compliant with JPA3.0 spec
Date Fri, 23 Oct 2009 21:00:00 GMT

     [ https://issues.apache.org/jira/browse/GERONIMO-4928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Quintin Beukes updated GERONIMO-4928:
-------------------------------------

    Description: 
{panel:title=EJB 3.0 JPA spec FR, section 6.2.1.6}
The set of managed persistence classes that are managed by a persistence unit is defined by
using one or
more of the following:[41]
     • One or more object/relational mapping XML files
     • One or more jar files that will be searched for classes
     • An explicit list of the classes
     • The annotated managed persistence classes contained in the root of the persistence
unit (unless
         the exclude-unlisted-classes element is specified)
{panel}

{panel:title=further on in the same section}
All classes must be on the classpath to ensure that entity managers from different persistence
units that
map the same class will be accessing the same identical class.
{panel}

This says that if exclude-unlisted-classes is specified as true, then only the classes listed
in <class> elements must be used in the PU. If it is specified as false, then the annotated
classes must be included. It's the only thing that exclude-unlisted-classes affects. It doesn't
affect classes from other units, and if false it doesn't say that <class> must be ignored,
which is what the following code does in PersistenceUnitBuilder.java:

{code:title=PersistenceUnitBuilder.java line 310|borderStyle=solid}
if (excludeUnlistedClasses) {
    gbeanData.clearAttribute("jarFileUrls");
} else {
    gbeanData.clearAttribute("managedClassNames");
}
{code}

I removed the else block to leave:
{code:title=PersistenceUnitBuilder.java Patched|borderStyle=solid}
if (excludeUnlistedClasses) {
    gbeanData.clearAttribute("jarFileUrls");
}
{code}

Without this Geronimo isn't JavaEE 5 compliant.


  was:
According to the final release of the EJB 3.0 JPA spec, section 6.2.1.6:
The set of managed persistence classes that are managed by a persistence unit is defined by
using one or
more of the following:[41]
     • One or more object/relational mapping XML files
     • One or more jar files that will be searched for classes
     • An explicit list of the classes
     • The annotated managed persistence classes contained in the root of the persistence
unit (unless
         the exclude-unlisted-classes element is specified)

... further on...
All classes must be on the classpath to ensure that entity managers from different persistence
units that
map the same class will be accessing the same identical class.

This says that if exclude-unlisted-classes is specified as true, then only the classes listed
in <class> elements must be used in the PU. If it is specified as false, then the annotated
classes must be included. It's the only thing that exclude-unlisted-classes affects. It doesn't
affect classes from other units, and if false it doesn't say that <class> must be ignored,
which is what the following code does in PersistenceUnitBuilder.java:

        if (excludeUnlistedClasses) {
            gbeanData.clearAttribute("jarFileUrls");
        } else {
            gbeanData.clearAttribute("managedClassNames");
        }

I removed the else block to leave:

        if (excludeUnlistedClasses) {
            gbeanData.clearAttribute("jarFileUrls");
        }

Without this Geronimo isn't JavaEE 5 compliant.



Edited the JIRA to add some formatting for readability.

> In the JPA persistence.xml loading code, exclude-unlisted-classes handling not compliant
with JPA3.0 spec
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-4928
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4928
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: deployment, persistence
>    Affects Versions: 2.1.4
>            Reporter: Quintin Beukes
>             Fix For: 2.1.4, 2.2, 3.0
>
>         Attachments: external-jpa-entity-reference.patch
>
>
> {panel:title=EJB 3.0 JPA spec FR, section 6.2.1.6}
> The set of managed persistence classes that are managed by a persistence unit is defined
by using one or
> more of the following:[41]
>      • One or more object/relational mapping XML files
>      • One or more jar files that will be searched for classes
>      • An explicit list of the classes
>      • The annotated managed persistence classes contained in the root of the persistence
unit (unless
>          the exclude-unlisted-classes element is specified)
> {panel}
> {panel:title=further on in the same section}
> All classes must be on the classpath to ensure that entity managers from different persistence
units that
> map the same class will be accessing the same identical class.
> {panel}
> This says that if exclude-unlisted-classes is specified as true, then only the classes
listed in <class> elements must be used in the PU. If it is specified as false, then
the annotated classes must be included. It's the only thing that exclude-unlisted-classes
affects. It doesn't affect classes from other units, and if false it doesn't say that <class>
must be ignored, which is what the following code does in PersistenceUnitBuilder.java:
> {code:title=PersistenceUnitBuilder.java line 310|borderStyle=solid}
> if (excludeUnlistedClasses) {
>     gbeanData.clearAttribute("jarFileUrls");
> } else {
>     gbeanData.clearAttribute("managedClassNames");
> }
> {code}
> I removed the else block to leave:
> {code:title=PersistenceUnitBuilder.java Patched|borderStyle=solid}
> if (excludeUnlistedClasses) {
>     gbeanData.clearAttribute("jarFileUrls");
> }
> {code}
> Without this Geronimo isn't JavaEE 5 compliant.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message