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

Bug 347219

Summary: NullPointerException: Change a mapping to element collection mapping
Product: [WebTools] Dali JPA Tools Reporter: Nan Li <nan.n.li>
Component: GeneralAssignee: Karen Butzke <karenfbutzke>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jolene.moffitt, karenfbutzke, neil.hauge
Version: unspecifiedFlags: neil.hauge: review+
Target Milestone: 3.0.1   
Hardware: PC   
OS: Windows 7   
Whiteboard: fix_ready
Attachments:
Description Flags
Stack Trace
none
proposed patch against head none

Description Nan Li CLA 2011-05-25 16:15:24 EDT
Build Identifier: I20110519-1138

1. Create a mapping file and add a type mapping to it
2. In the JPA structure pane, add an attribute to the mapping file
3. Right-click the attribute and select Map As -> Element Collection

A NPE is thrown saying 

java.lang.NullPointerException
	at org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.AbstractOrmElementCollectionMapping2_0$AbstractOwner.resolveDbTable(AbstractOrmElementCollectionMapping2_0.java:1313)

A full stack trace is attached.

Reproducible: Always
Comment 1 Nan Li CLA 2011-05-25 16:16:20 EDT
Created attachment 196607 [details]
Stack Trace
Comment 2 Karen Butzke CLA 2011-06-07 10:25:48 EDT
Must be connected to a database to get this exception
Comment 3 Karen Butzke CLA 2011-06-07 10:45:05 EDT
Created attachment 197502 [details]
proposed patch against head
Comment 4 Karen Butzke CLA 2011-06-07 10:46:27 EDT
The attached patch uses Tools.valuesAreEqual which does a null check on the table names
Comment 5 Karen Butzke CLA 2011-06-24 08:01:41 EDT
checked in to HEAD for 3.0.1
Comment 6 Jolene Moffitt CLA 2011-08-02 10:54:06 EDT
Verified in Build I-3.4.0-20110731180834

Verified you can add an attribute to a mapping file and change it to Element Collection without error.  see the link to view test steps for verification. 
http://wiki.eclipse.org/Dali_3.0.1