Bug 454898

Summary: ClassAccessor method "processDerivedId" breaks for inheritanced referenceAccessor
Product: z_Archived Reporter: Tobias Kahl <mail>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: mail
Version: unspecifiedKeywords: core
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch to solve the problem none

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