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

Bug 342055

Summary: Abstract Entity With No Subclasses Treated As Concrete Resulting in IntegrityException
Product: z_Archived Reporter: Dave M <dmuirhead>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P2 CC: tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Dave M CLA 2011-04-06 13:33:58 EDT
Build Identifier: 2.1.2.v20101206-r8635

An abstract class annotated with @Entity that does not (in a given situation) have any concrete subclasses is treated as concrete by EclipseLink, resulting in an IntegrityException( caused by InstantiationException) being thrown out of DatabaseSessionImpl.initializeDescriptors.

An abstract class may need to be annotated with @Entity if there is polymorphic query logic that targets/specifies the abstract class.

An abstract Entity may not have concrete subclasses in a given situation if that class is an optional part of a framework.

Adding a concrete subclass prevents the exception.

See http://www.eclipse.org/forums/index.php?t=msg&th=206726 for full scenario and stack trace.


Reproducible: Always

Steps to Reproduce:
1. Apply @Entity annotation to an abstract class
2. Do no create any concrete subclasses of the abstract entity
3. Attempt to obtain an entity manager for the persistence unit containing the abstract entity
Comment 1 Tom Ware CLA 2011-05-12 15:30:27 EDT
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 2 Eclipse Webmaster CLA 2022-06-09 10:20:59 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink