Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370779 - Refactoring NPE moving an id class that is specified in java
Summary: Refactoring NPE moving an id class that is specified in java
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-06 17:09 EST by Karen Butzke CLA
Modified: 2012-02-28 13:42 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-06 17:09:58 EST
Employee and EmployeeId are specified in com.foo package

@Entity
@IdClass(EmployeeId.class)
public class Employee {
}

<entity class="com.foo.Employee">
	<attributes>
		<id name="id">
		</id>
	</attributes>
</entity>

Move the EmployeeId class to another package and the following NPE occurs because it is attempting to rename the id-class reference in the orm.xml when none exists.

java.lang.NullPointerException
	at org.eclipse.jpt.jpa.core.internal.context.orm.GenericOrmIdClassReference.createRenamePackageEdit(GenericOrmIdClassReference.java:323)
	at org.eclipse.jpt.jpa.core.internal.context.orm.GenericOrmIdClassReference.createMoveTypeEdits(GenericOrmIdClassReference.java:312)
	at org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmEntity.createIdClassMoveTypeEdits(AbstractOrmEntity.java:1706)
	at org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmEntity.createMoveTypeEdits(AbstractOrmEntity.java:1702)
Comment 1 Karen Butzke CLA 2012-02-09 14:47:31 EST
fixed in M6
Comment 2 Jolene Moffitt CLA 2012-02-28 13:42:07 EST
Verified in Build I-3.4.0-20120223091229 

Verified when you refactor/move a class no NPE appears and the class is updated in correctly.  See the link to view test steps for verification. 
http://wiki.eclipse.org/Dali_3.2_M6