Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342340 - Maps abstract class field (generic) to interface instead of concrete class
Summary: Maps abstract class field (generic) to interface instead of concrete class
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-08 21:02 EDT by Lloyd Fernandes CLA
Modified: 2022-06-09 10:28 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lloyd Fernandes CLA 2011-04-08 21:02:38 EDT
Build Identifier: 2.3.0-20110326.050514-69

When a subclass does not implement interface of parent class then the parent subclass does not get mapped to correct concrete class

In the below case, for class C, field A in class AbsA resolves to interface P instead of class BA

@mappedsuperclass
abstract class AbsA <A extends W, B extends Y, C extends Z> impelents P, Q, R, serialzable
{
A fieldA;
B fieldB;
@manyToOne
C fieldC;
}

@mappedsuperclass
abstract class AbsB <EA extends A, EC extends C> extends<EA,BY,EC> impelements serialzable
{
Z fieldz;
}

@entity 
class C extends AbdB<BA,BC> implements serializable
{

}



Reproducible: Always
Comment 1 Lloyd Fernandes CLA 2011-04-08 21:09:10 EDT
Ofcourse Workaround is to make sure Class AbsB & C implement P,Q,R
Comment 2 Lloyd Fernandes CLA 2011-04-09 08:10:38 EDT
The above workaround did not work in all cases. In addition to making sure all interfaces were implemented by subclass, I calso had to make sure the number of generic type arguments had to be same.

@mappedsuperclass
abstract class AbsB <EA extends A, EB extends BY, EC extends C> extends<EA,EB,EC> impelements
serialzable
{
Z fieldz;
}

@entity 
class C extends AbsB<BA, BY, BC> implements serializable
{

}
Comment 3 Tom Ware CLA 2011-04-28 10:14:14 EDT
Can you please describe the symptoms of the problem?  i.e. what is the code you are running and how is the behavior different from what you expect?
Comment 4 Tom Ware CLA 2011-05-12 15:31:25 EDT
Still awaiting symptoms of the problem.

For now:

Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 5 Lloyd Fernandes CLA 2011-07-26 09:11:35 EDT
Switched to Hibernate due to poor support for complex generics and too much difficulty in getting issues resolved
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:28:36 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink