Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] Fix for bug 314906 : Metamodel PluralAttribute.getJavaType() returns elementType instead of collection type class

Everyone,
The following patch for bug# 314906 and DI# 104 is available for code review. The issue is that PluralAttribute.getJavaType() is acting the same getElementType() - behaving the same as SingularAttribute when elementType is null.

   Issue:
in public abstract class PluralAttributeImpl<X, C, V> extends
AttributeImpl<X, C> implements PluralAttribute<X, C, V> {
we should be using * @param <C> The type of the represented collection
not * @param <V> The element type of the represented collection

Essentially the fix is to move getJavaType() down into the Set, List, Map and CollectionAttribute subclasses and return the java type of the collection there directly.
   thank you to Roger Suen for finding and reporting on this issue.

http://bugs.eclipse.org/314906
https://bugs.eclipse.org/bugs/attachment.cgi?id=171844&action=diff
http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/metamodel_api#DI_104:_20100614:_314906:_PluralAttribute.getJavaType_returns_elementType_instead_of_Collection_Type

>Added 3 new tests, extended/modified 7 others
>Test results
TEST MODEL NAME: (JUnit test): MetamodelMetamodelTest
Errors: (failures): 0
Fatal Errors: (errors): 0
Passed: 127
Total Tests: 127

TEST MODEL NAME: (JUnit test): Criteria
Errors: (failures): 0
Fatal Errors: (errors): 0
Passed: 141
Total Tests: 141

   thank you
   /michael



Back to the top