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

Bug 313911

Summary: NPE with empty string name for table/sequence generator
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: JPAAssignee: Neil Hauge <neil.hauge>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: nan.n.li, neil.hauge
Version: 2.3   
Target Milestone: Future   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.