Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332154 - [Validation] Need validation for the type of targetEntity
Summary: [Validation] Need validation for the type of targetEntity
Status: NEW
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Neil Hauge CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-08 12:24 EST by Nan Li CLA
Modified: 2011-07-01 16:25 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nan Li CLA 2010-12-08 12:24:28 EST
Build Identifier: 20100917-0705

When specifying the targetEntity attribute for a relationship mapping, it's necessary to verify the type of the given target entity to check whether or not it's compatible with the type of the mapped property. There are four cases:

1. For one-to-one and many-to-one mapping, type incompatibility should be reported.
2. For one-to-many and many-to-many mapping, no validation error should be reported without using generics.
3. For one-to-many and many-to-many mapping, type incompatibility should be reported with using generics.
4. When the given target entity is a subclass of the type of the mapped property, no validation error should be reported.

Type incompatibility may not lead to deployment error, but could result in broken program.

Reproducible: Always
Comment 1 Neil Hauge CLA 2011-07-01 16:25:53 EDT
Moving JPA specific bugs to new JPA component in bugzilla.