Bug 454898 - ClassAccessor method "processDerivedId" breaks for inheritanced referenceAccessor
Summary: ClassAccessor method "processDerivedId" breaks for inheritanced referenceAcce...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords: core
Depends on:
Blocks:
 
Reported: 2014-12-11 10:14 EST by Tobias Kahl CLA
Modified: 2022-06-09 10:20 EDT (History)
1 user (show)

See Also:


Attachments
Patch to solve the problem (1.58 KB, patch)
2015-10-15 03:10 EDT, Tobias Kahl CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Kahl CLA 2014-12-11 10:14:33 EST
While processing the dericed id the order of processing the Accessors ist very important.

To take care about this the method already contains a part like this:

	if (referenceAccessor.hasDerivedId()) {    
		referenceAccessor.processDerivedId(processing, processed);
	}

And the referenceAccessor is delegating to the descriptor:
	public boolean hasDerivedId() {
		return ! getDescriptor().getDerivedIdAccessors().isEmpty();
	}

This Method also returns "false" for Inheritance-Subclasses where the Inheritance-Superclass has a dericed Id!


That's while the following fails.
If someOtherClass is processed before city will be processed, the implementation actually will return "referenceAccessor.hasDerivedId() = false".

class composedKey{
	
	@id
	int idFieldOne
	
	@id
	int idFieldTwo
}

class city{

	@id
	composedKey myKey;
}

class mayorCity extends city{

	// no Id-Fields
}

class someOtherClass{

	@id
	mayorCity myMayorCitie;
}
Comment 1 Tobias Kahl CLA 2015-10-15 03:10:41 EDT
Created attachment 257274 [details]
Patch to solve the problem
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:20:58 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink