Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347219 - NullPointerException: Change a mapping to element collection mapping
Summary: NullPointerException: Change a mapping to element collection mapping
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.0.1   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard: fix_ready
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-25 16:15 EDT by Nan Li CLA
Modified: 2011-08-02 10:54 EDT (History)
3 users (show)

See Also:
neil.hauge: review+


Attachments
Stack Trace (7.66 KB, text/plain)
2011-05-25 16:16 EDT, Nan Li CLA
no flags Details
proposed patch against head (1.14 KB, patch)
2011-06-07 10:45 EDT, Karen Butzke CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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