Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 370779

Summary: Refactoring NPE moving an id class that is specified in java
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: JPAAssignee: Karen Butzke <karenfbutzke>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jolene.moffitt
Version: 3.1   
Target Milestone: 3.2 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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