Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337293 - NullPointerException for combination of complex Primary Key and JOINED Inheritance type
Summary: NullPointerException for combination of complex Primary Key and JOINED Inheri...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 major with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-16 05:31 EST by Piotr Wawrzyniak CLA
Modified: 2022-06-09 10:22 EDT (History)
1 user (show)

See Also:


Attachments
The log file (25.80 KB, text/plain)
2011-02-16 05:32 EST, Piotr Wawrzyniak CLA
no flags Details
The zipped eclipse project (5.77 KB, application/octet-stream)
2011-02-16 05:37 EST, Piotr Wawrzyniak CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Wawrzyniak CLA 2011-02-16 05:31:37 EST
Build Identifier: 2.1.2.v20101206-r8635

If entities in project use complex primary key containing other entity and use JOINED inheritance insertion of data fails on commit. For inheritance SINGLE TABLE work fine. As can be see in logs problems probably on previous insert without all mandatory fields.

Reproducible: Always

Steps to Reproduce:
1. Create entity A
2. Create entity Parent with key based on A and int fields
3. Create entity Child with key based on A and int fields and referencing Parent
4. Create entities ChildX and ChildY extends the Child
5. Try to insert data in such structure

or

1. Create DB using test.sql from the attached project (tested on PostgreSQL 9.0)
2. Run Test class in attached project
Comment 1 Piotr Wawrzyniak CLA 2011-02-16 05:32:40 EST
Created attachment 189081 [details]
The log file
Comment 2 Piotr Wawrzyniak CLA 2011-02-16 05:37:54 EST
Created attachment 189082 [details]
The zipped eclipse project

Script for create database in src/jpa/test.sql
Comment 3 Piotr Wawrzyniak CLA 2011-02-16 06:01:53 EST
Can be avoid if add the duplicated reference to key entity in derived classes (ChildX and ChildY) in project.
Like this:
@ManyToOne
@JoinColumn(name="a_id")
public A getA_() {
  return getA();
}
public void setA_(A a) {
  setA(a);
}
but occurs error at read data, see bug 337297
Comment 4 Tom Ware CLA 2011-02-24 08:30:39 EST
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 Eclipse Webmaster CLA 2022-06-09 10:22:42 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink