Bug 256928

Summary: AggregateTestModel using SubstituteSequencingWithReturningPolicyAdapter failed
Product: z_Archived Reporter: Edwin Tang <edwin.tang>
Component: EclipselinkAssignee: Andrei Ilitchev <andrei.ilitchev>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: andrei.ilitchev, eclipselink.foundation-inbox, tom.ware
Version: unspecifiedKeywords: test
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
The patch. none

Description Edwin Tang CLA 2008-11-28 13:19:18 EST
Oracle specific test - AggregateTestModel using SubstituteSequencingWithReturningPolicyAdapter failed.

Exception:
==========
Descriptor Exceptions: --------------------------------------------------------- Exception [EclipseLink-188] (Eclipse Persistence Services - 1.1.0 (Build 20081128)): org.eclipse.persistence.exceptions.DescriptorException Exception Description: ReturningPolicy contains unmapped field, [CUSTOMER_ID] which requires type. Descriptor: RelationalDescriptor(org.eclipse.persistence.testing.models.aggregate.Customer --> [DatabaseTable(BUILDER_CUSTOMER)]) Runtime Exceptions: ---------------------------------------------------------

Local Exception Stack:
Exception [EclipseLink-0] (Eclipse Persistence Services - 1.1.0 (Build 20081128)): org.eclipse.persistence.exceptions.IntegrityException
Descriptor Exceptions:
---------------------------------------------------------

Exception [EclipseLink-188] (Eclipse Persistence Services - 1.1.0 (Build 20081128)): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: ReturningPolicy contains unmapped field, [CUSTOMER_ID] which requires type.
Descriptor: RelationalDescriptor(org.eclipse.persistence.testing.models.aggregate.Customer --> [DatabaseTable(BUILDER_CUSTOMER)])

Runtime Exceptions:
---------------------------------------------------------

at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:476)
at org.eclipse.persistence.sessions.Project.addDescriptors(Project.java:246)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.addDescriptors(DatabaseSessionImpl.java:237)
at org.eclipse.persistence.testing.tests.returning.TestSystemAdapted.addDescriptors(TestSystemAdapted.java:81)
at org.eclipse.persistence.testing.framework.TestSystem.run(TestSystem.java:165)
at org.eclipse.persistence.testing.framework.TestExecutor.forceConfigureSystem(TestExecutor.java:275)
at org.eclipse.persistence.testing.framework.TestModel.configure(TestModel.java:188)
at org.eclipse.persistence.testing.framework.TestModel.setupEntity(TestModel.java:409)
at org.eclipse.persistence.testing.framework.TestModel.execute(TestModel.java:200)
at org.eclipse.persistence.testing.framework.TestCollection.run(TestCollection.java:312)
at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:247)
at org.eclipse.persistence.testing.framework.TestModel.execute(TestModel.java:208)
at org.eclipse.persistence.testing.framework.TestCollection.run(TestCollection.java:312)
at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:247)
at org.eclipse.persistence.testing.framework.TestModel.execute(TestModel.java:208)
at org.eclipse.persistence.testing.framework.TestCollection.run(TestCollection.java:312)

Descriptor Exceptions:
---------------------------------------------------------


Local Exception Stack:
Exception [EclipseLink-188] (Eclipse Persistence Services - 1.1.0 (Build 20081128)): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: ReturningPolicy contains unmapped field, [CUSTOMER_ID] which requires type.
Descriptor: RelationalDescriptor(org.eclipse.persistence.testing.models.aggregate.Customer --> [DatabaseTable(BUILDER_CUSTOMER)])
at org.eclipse.persistence.exceptions.DescriptorException.returningPolicyUnmappedFieldTypeNotSet(DescriptorException.java:1806)
at org.eclipse.persistence.descriptors.ReturningPolicy.initialize(ReturningPolicy.java:648)
at org.eclipse.persistence.descriptors.ClassDescriptor.initialize(ClassDescriptor.java:2610)
at org.eclipse.persistence.mappings.AggregateCollectionMapping.initializeReferenceDescriptor(AggregateCollectionMapping.java:866)
at org.eclipse.persistence.mappings.ForeignReferenceMapping.initialize(ForeignReferenceMapping.java:760)
at org.eclipse.persistence.mappings.CollectionMapping.initialize(CollectionMapping.java:662)
at org.eclipse.persistence.mappings.AggregateCollectionMapping.initialize(AggregateCollectionMapping.java:771)
at org.eclipse.persistence.descriptors.ClassDescriptor.initialize(ClassDescriptor.java:2505)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:447)
at org.eclipse.persistence.sessions.Project.addDescriptors(Project.java:246)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.addDescriptors(DatabaseSessionImpl.java:237)
at org.eclipse.persistence.testing.tests.returning.TestSystemAdapted.addDescriptors(TestSystemAdapted.java:81)
at org.eclipse.persistence.testing.framework.TestSystem.run(TestSystem.java:165)
at org.eclipse.persistence.testing.framework.TestExecutor.forceConfigureSystem(TestExecutor.java:275)
at org.eclipse.persistence.testing.framework.TestModel.configure(TestModel.java:188)
at org.eclipse.persistence.testing.framework.TestModel.setupEntity(TestModel.java:409)
at org.eclipse.persistence.testing.framework.TestModel.execute(TestModel.java:200)
at org.eclipse.persistence.testing.framework.TestCollection.run(TestCollection.java:312)
at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:247)
at org.eclipse.persistence.testing.framework.TestModel.execute(TestModel.java:208)
at org.eclipse.persistence.testing.framework.TestCollection.run(TestCollection.java:312)
at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:247)
at org.eclipse.persistence.testing.framework.TestModel.execute(TestModel.java:208)
at org.eclipse.persistence.testing.framework.TestCollection.run(TestCollection.java:312)

Runtime Exceptions:
---------------------------------------------------------
Comment 1 Tom Ware CLA 2008-12-03 13:15:44 EST
Setting to 1.1x pending information about if this is a regression.  If it is, target will set to 1.1.
Comment 2 Edwin Tang CLA 2008-12-04 11:27:25 EST
It is a regression. It started to fail on Nov 20th, 2008.
Comment 3 Edwin Tang CLA 2008-12-04 15:43:44 EST
This was caused by Andrei's checkin - "Bug 248293: JPA 2.0 Element Collections." in revision 2794.

Steps for running "AggregateTestModel using
SubstituteSequencingWithReturningPolicyAdapter",
1. From trunk, execute "ant build" to compiles all components and tests (excluding Oracle extensions)
2. From trunk, execute "ant build-oracle-extension" to compile Oracle extensions and tests
3. From trunk/foundation/eclipselink.extension.oracle.test, execute "ant test-browser" to start the testing browser
4. The model is under Oracle Tests -> OracleTestModel -> ReturningPolicyTestModel in the testing browser
Comment 4 Andrei Ilitchev CLA 2008-12-05 17:16:17 EST
Created attachment 119679 [details]
The patch.

The patch fixes both ReturningPolicy and tests.
The changes in both places due to the fact that AggregateCollectionMapping now clones the reference descriptor - and initializes the clone (possibly overriding tables and fields).
ReturningPolicy had to use buildField that returns back the corresponding field in descriptor (that may have a different name - the one supplied to AggregateCollectionMapping).
The test has to create trigger for the new table (added through AggregateCollectionMapping and overriding the original one), too.
Comment 5 Andrei Ilitchev CLA 2008-12-05 17:17:56 EST
Fixed.
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:07:25 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 7 Eclipse Webmaster CLA 2022-06-09 10:14:51 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink