Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370342 - partial package in the package element should not be supported in the orm.xml
Summary: partial package in the package element should not be supported in the orm.xml
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M6   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-01 10:59 EST by Karen Butzke CLA
Modified: 2012-02-28 11:20 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2012-02-01 10:59:17 EST
We currently support partial packages in the package element in orm.xml. I have not yet discovered where we came up with this requirement, but I do know that neither EclipseLink nor Hibernate JPA implementations support this.

<package>com.foo</package>
<entity class="model.Employee"</entity>

We first looks for a class named model.Employee and if we don't find it we look for the class com.foo.model.Employee. The runtime implementations will only work if the class model.Employee exists. Basically, they check if the entity class is qualified (contains a '.') and use that as the fully qualified name. If the entity class is not qualified, then they prepend "com.foo" to the class name. 


1. This use case will work for generic JPA implementations

    <package>com.foo.model</package>
    <entity class="Employee"</entity>
    <entity class="com.foo.model.Address"</entity>


2. EclipseLink supports this use case as well, notice the '.' at the end of the package name. Hibernate does not support this use case. I have not tested any other JPA implementations so will assume this was not the intent of the JPA spec.

    <package>com.foo.model.</package>
    <entity class="Employee"</entity>
    <entity class="com.foo.model.Address"</entity>
Comment 1 Karen Butzke CLA 2012-02-02 11:36:02 EST
fixed in 3.2M6
Comment 2 Karen Butzke CLA 2012-02-09 14:27:49 EST
The provisional API additions listed https://bugs.eclipse.org/bugs/show_bug.cgi?id=277017#c4 were made for this bug as well. Also, OrmPersistentType.mappingClassChanged(String, String) provisional API was removed.
Comment 3 Jolene Moffitt CLA 2012-02-28 11:20:49 EST
Verified in Build I-3.4.0-20120223091229 

Verified when you split the package name in the orm or eclipselink orm mapping files that you receive an error message.  Also verified the other use cases below work per comment 1.  See the link to view test steps for verification.  http://wiki.eclipse.org/Dali_3.2_M6