Bug 342055 - Abstract Entity With No Subclasses Treated As Concrete Resulting in IntegrityException
Summary: Abstract Entity With No Subclasses Treated As Concrete Resulting in Integrity...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-06 13:33 EDT by Dave M CLA
Modified: 2022-06-09 10:20 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 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