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

Bug 339603

Summary: NPE validating attribute override name when there is no type to override
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: GeneralAssignee: Nan Li <nan.n.li>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: neil.hauge
Version: 3.0Flags: neil.hauge: review+
Target Milestone: 3.0 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed Patch
none
Proposed Patch neil.hauge: iplog+

Description Karen Butzke CLA 2011-03-10 16:52:30 EST
Given this java entity, the attached NPE occurs when trying to validate the attribute override. This prevents the rest of the JPA validation from completing.

@Entity
@AttributeOverride(name="bar")
public class Bar {

	@Id
	private int id;
}


You can also see this problem in orm.xml. Remove the AttributeOverride annotation from the java and add this entity to the orm.xml:
<entity class="model.Bar">
	<attribute-override name="bar"></attribute-override>
</entity>


If the class model.Bar is not found, the same exception occurs.
Comment 1 Nan Li CLA 2011-04-22 16:56:51 EDT
Created attachment 193948 [details]
Proposed Patch

For jpa_validation.properties and JpaValidationMessages.java, each has the following two new entries:

ATTRIBUTE_OVERRIDE_INVALID_TYPE
VIRTUAL_ATTRIBUTE_OVERRIDE_INVALID_TYPE
Comment 2 Neil Hauge CLA 2011-04-25 17:32:16 EDT
Perhaps this chance can be merged into the updated patch for bug 335741.
Comment 3 Nan Li CLA 2011-04-26 10:04:49 EDT
Created attachment 194054 [details]
Proposed Patch

Merged the changes of messages to the patch of bug 335741. This patch only includes one file.
Comment 4 Neil Hauge CLA 2011-04-26 17:37:12 EDT
Committed to head.