Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339603 - NPE validating attribute override name when there is no type to override
Summary: NPE validating attribute override name when there is no type to override
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Nan Li CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-10 16:52 EST by Karen Butzke CLA
Modified: 2011-04-26 17:37 EDT (History)
1 user (show)

See Also:
neil.hauge: review+


Attachments
Proposed Patch (102.51 KB, patch)
2011-04-22 16:56 EDT, Nan Li CLA
no flags Details | Diff
Proposed Patch (2.29 KB, patch)
2011-04-26 10:04 EDT, Nan Li CLA
neil.hauge: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.