Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313911 - NPE with empty string name for table/sequence generator
Summary: NPE with empty string name for table/sequence generator
Status: NEW
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 2.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: Neil Hauge CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-21 09:37 EDT by Karen Butzke CLA
Modified: 2011-07-01 16:25 EDT (History)
2 users (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 2010-05-21 09:37:31 EDT
Create the following Entity with the JPA Details view open.
Select the @TableGenerator annotation and choose the Quick Fix 'Add missing attributes'. You'll get an NPE.  No real side effect to this, just a logged NPE, if you type in a name the table generator name text field updates without problems.

@Entity
public class Employee {
    @Id
	@TableGenerator
	@SequenceGenerator
	private int id; 
}


Caused by: java.lang.NullPointerException
	at org.eclipse.jpt.ui.internal.details.GeneratedValueComposite$3.setValue(GeneratedValueComposite.java:150)
	at org.eclipse.jpt.ui.internal.details.GeneratedValueComposite$3.setValue(GeneratedValueComposite.java:1)
	at org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter.selectionChanged(AbstractComboModelAdapter.java:499)
	at org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter.comboSelectionChanged(AbstractComboModelAdapter.java:491)
	at org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter$3.modifyText(AbstractComboModelAdapter.java:223)
Comment 1 Nan Li CLA 2010-11-18 11:32:07 EST
Similar exception is thrown when first clicking the drop-down arrow of the 'Generator name' list of 'Primary key generation' in the JPA Details view, and then choosing another mapping in the JPA Structure view. A fragment of the exception is as the following:

java.lang.NullPointerException
	at org.eclipse.jpt.ui.internal.details.GeneratedValueComposite$3.setValue_(GeneratedValueComposite.java:158)
	at org.eclipse.jpt.ui.internal.details.GeneratedValueComposite$3.setValue(GeneratedValueComposite.java:147)
	at org.eclipse.jpt.ui.internal.details.GeneratedValueComposite$3.setValue(GeneratedValueComposite.java:1)
	at org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter.selectionChanged(AbstractComboModelAdapter.java:499)
	at org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter.comboSelectionChanged(AbstractComboModelAdapter.java:491)
	at org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter$3.modifyText(AbstractComboModelAdapter.java:223)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:173)
Comment 2 Neil Hauge CLA 2011-07-01 16:25:51 EDT
Moving JPA specific bugs to new JPA component in bugzilla.