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

Bug 330600

Summary: Code completion for joinColumns and inverseJoinColumns elements of JoinTable annotation
Product: [WebTools] Dali JPA Tools Reporter: Nan Li <nan.n.li>
Component: JPAAssignee: Neil Hauge <neil.hauge>
Status: ASSIGNED --- QA Contact:
Severity: minor    
Priority: P3 CC: nan.n.li, neil.hauge
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 330622    
Bug Blocks:    

Description Nan Li CLA 2010-11-18 14:24:54 EST
Build Identifier: 20100917-0705

The 'name' element of inverseJoinColumns and joinColumns elements of JoinTable annotation is missing if the 'name' element of JoinTable annotation is specified.

Note: Same issue exists with the 'name' element of joinColumns element of CollectionTable annotation when the 'name' element of CollectionTable annotation is specified.

Reproducible: Always

Steps to Reproduce:
1. Apply @JoinTable annotation to an attribute of a Java entity
2. Specify the name element of JoinTable annotation
3. Specify the joinColumns element of JoinTable annotation
4. Try to use code completion to input the name element of the @JoinColumn, which is the value of joinColumns element

The annotation would look like
@JoinTable(name = "PROJ_EMP", joinColumns = @JoinColumn())

The 'name' element is missing from the list of the elements of @JoinColumn; however, if not specifying the 'name' element before specifing joinColumns/inverseJoinColumns, the 'name' element of @JoinColumn would show up.
Comment 1 Neil Hauge CLA 2010-11-18 17:25:47 EST
It also appears that the nested 'name' element will appear in code completion
if a value for 'name' has been specified or is empty string.  Also, if any
other element is specified in the nested annotation, the 'name' element will
appear in the completion list.

This would appear to be a bug in the JDT completion code.  I've reproduced with
a generic test case and have opened bug 330622 against the JDT.
Comment 2 Neil Hauge CLA 2011-07-01 16:25:02 EDT
Moving JPA specific bugs to new JPA component in bugzilla.