Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364408 - Unable to create JPA project with orm.xml containing many-to-one with a join-column
Summary: Unable to create JPA project with orm.xml containing many-to-one with a join-...
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P1 major (vote)
Target Milestone: 3.1 RC3   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-21 13:58 EST by Karen Butzke CLA
Modified: 2012-01-12 14:10 EST (History)
1 user (show)

See Also:
neil.hauge: review+


Attachments
proposed patch against HEAD (1.11 KB, patch)
2011-11-21 14:14 EST, 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 Karen Butzke CLA 2011-11-21 13:58:35 EST
Create a JPA project and create and orm.xml mapping file that contains the following entity and many-to-one mapping. Clean the project and you get an NPE logged and a JPA validation error 'This project has the JPA facet, but no JPA project could be created.  See the error log for more details.'


<entity class="model.foo">
    <attributes>
	<many-to-one name="bar">
            <join-column/>
	</many-to-one>
    </attributes>
</entity>


Nested exception 2: java.lang.NullPointerException
	at org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmNamedColumn.buildDefaultName(AbstractOrmNamedColumn.java:165)
	at org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmNamedColumn.update(AbstractOrmNamedColumn.java:85)
	at org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmBaseColumn.update(AbstractOrmBaseColumn.java:70)
Comment 1 Karen Butzke CLA 2011-11-21 14:14:51 EST
Created attachment 207330 [details]
proposed patch against HEAD
Comment 2 Karen Butzke CLA 2011-11-21 14:15:35 EST
checked in to HEAD for 3.1RC3
Comment 3 Neil Hauge CLA 2011-11-22 20:27:55 EST
For completeness:

This fix was required to fix a stop-ship regression in our XML mapping file support.  The fix is small, isolated, and low risk.  The fix was modeled after other similar code changes that were missed in this case.  The fix was reviewed and tested by me.
Comment 4 Neil Hauge CLA 2012-01-12 14:10:07 EST
See comment #2.