Issue Details (XML | Word | Printable)

Key: JDO-98
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Craig Russell
Reporter: Michelle Caisse
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JDO

TestArrayCollections: Field "ArrayOfBigDecimal13" in class "ArrayCollections" has been defined with elements that arent embedded. JPOX doesnt support this

Created: 27/Jul/05 07:33 AM   Updated: 23/Apr/06 02:46 AM
Return to search
Component/s: tck2
Affects Version/s: None
Fix Version/s: JDO 2 beta

Time Tracking:
Not Specified

Resolution Date: 23/Apr/06 02:46 AM


 Description  « Hide
test(org.apache.jdo.tck.models.fieldtypes.TestArrayCollections)org.jpox.metadata.InvalidMetaDataException: Field "ArrayOfBigDecimal13" in class "ArrayCollections" has been defined with elements that arent embedded. JPOX doesnt support this - the elements must be embedded.
at org.jpox.metadata.ArrayMetaData.populate(ArrayMetaData.java:106)
at org.jpox.metadata.FieldMetaData.populate(FieldMetaData.java:662)
at org.jpox.metadata.ClassMetaData.populate(ClassMetaData.java:697)
at org.jpox.metadata.MetaDataManager.populateClassesInFile(MetaDataManager.java:635)
at org.jpox.metadata.MetaDataManager.getMetaDataForClassOrInterface(MetaDataManager.java:399)
at org.jpox.metadata.MetaDataManager.getMetaDataForClass(MetaDataManager.java:308)
at org.jpox.AbstractPersistenceManager.hasMetaDataForPersistenceCapableClass(AbstractPersistenceManager.java:381)
at org.jpox.AbstractPersistenceManager.assertPersistenceCapable(AbstractPersistenceManager.java:412)
at org.jpox.AbstractPersistenceManager.internalMakePersistent(AbstractPersistenceManager.java:950)
at org.jpox.AbstractPersistenceManager.makePersistent(AbstractPersistenceManager.java:1048)
at org.apache.jdo.tck.models.fieldtypes.TestArrayCollections.runTest(TestArrayCollections.java:95)
at org.apache.jdo.tck.models.fieldtypes.TestArrayCollections.test(TestArrayCollections.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:197)
at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:128)
at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:106)

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Michelle Caisse made changes - 19/Aug/05 07:06 AM
Field Original Value New Value
Assignee Michelle Caisse [ mcaisse ]
Michelle Caisse added a comment - 19/Aug/05 07:07 AM
Mapping is messed up, needs to be redone.

Michelle Caisse made changes - 01/Oct/05 01:15 AM
Assignee Michelle Caisse [ mcaisse ] Erik Bengtson [ ebengtso ]
Michelle Caisse added a comment - 01/Oct/05 01:15 AM
JPOX supports arrays but not arrays mapped to join tables. Currently JDO allows an imple mentation not to support arrays, but if it does support arrays they are expected to support mapping to join tables.

Andy Jefferson added a comment - 08/Oct/05 07:48 PM
Looking through the test further I see no use of <join> to imply a join table to be used to hold the objects in the array.
For example, field "ArrayOfBigDecimal12" is defined in the JDO file as
<field name="ArrayOfBigDecimal12" >
<array embedded-element="true">
</array>
</field>

and in the ORM as
<field name="ArrayOfBigDecimal12" column="ARRAY_OF_BIG_DECIMAL12"/>

So the user wants this treated as a non-serialized field and the array (BigDecimal) elements should be embedded. Where should they be embedded ? We have a column specified on the field. Shouldn't this be a table, and also have a join element ?

Michelle Caisse made changes - 11/Oct/05 06:13 AM
Assignee Erik Bengtson [ ebengtso ] Michelle Caisse [ mcaisse ]
Repository Revision Date User Message
ASF #320862 Thu Oct 13 18:28:29 UTC 2005 mcaisse JDO-98 Fixed mapping for ArrayCollections
Files Changed
MODIFY /incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema.sql
MODIFY /incubator/jdo/trunk/tck20/test/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/ArrayCollections.jdo
MODIFY /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/fieldtypes/ArrayCollections.java
MODIFY /incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/ArrayCollections-derby.orm
MODIFY /incubator/jdo/trunk/tck20/test/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/ArrayCollections.jdo
MODIFY /incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema.sql
MODIFY /incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/ArrayCollections-derby.orm

Michelle Caisse added a comment - 14/Oct/05 03:33 AM
I fixed the mapping for this class - revision 320862.
We get to the point where JPOX has not implemented support for arrays of some data types:
test(org.apache.jdo.tck.models.fieldtypes.TestArrayCollections)org.jpox.metadata.InvalidMetaDataException: Cannot persist field "ArrayOfDate8" of class "ArrayCollections" since it is of an array type that is not supported by JPOX. Please consider making this a Collection field.
at org.jpox.metadata.FieldMetaData.populate(FieldMetaData.java:825)
...

Michelle Caisse made changes - 14/Oct/05 03:33 AM
Assignee Michelle Caisse [ mcaisse ] Andy Jefferson [ ajsoft ]
Andy Jefferson added a comment - 22/Oct/05 05:09 PM
JPOX CVS has support for much more in the array world now (like arrays of String, Date, etc, and persisting using a join table). Things like arrays of interfaces are supported partially. I suggest that you give it a try with the latest build

Andy Jefferson added a comment - 26/Oct/05 02:09 PM
With JPOX latest build this now fails with

test(org.apache.jdo.tck.models.fieldtypes.TestArrayCollections)javax.jdo.JDOUserException: Field "org.apache.jdo.tck.pc.fieldtypes.ArrayCollections.ArrayOfObject1" i
s declared as a reference type (interface/Object) but no implementation classes of "class java.lang.Object" have been found!
        at org.jpox.store.rdbms.table.ColumnCreator.getImplementationNamesForReferenceField(ColumnCreator.java:244)
        at org.jpox.store.rdbms.table.ColumnCreator.createColumnsForReferenceField(ColumnCreator.java:310)
        at org.jpox.store.rdbms.table.ColumnCreator.createColumnsForField(ColumnCreator.java:399)
        at org.jpox.store.rdbms.table.ColumnCreator.createColumns(ColumnCreator.java:94)

consequently the MetaData needs updates so that implementations can map it.

Andy Jefferson made changes - 26/Oct/05 02:09 PM
Assignee Andy Jefferson [ ajsoft ] Michelle Caisse [ mcaisse ]
Michelle Caisse added a comment - 26/Oct/05 08:43 PM
What metadata can be used so implementation can map this?

Michelle Caisse made changes - 26/Oct/05 08:43 PM
Assignee Michelle Caisse [ mcaisse ] Craig Russell [ clr ]
Craig Russell added a comment - 05/Nov/05 04:33 AM
Issue 137 has been raised on the JDO expert group to allow specification of element-type for array. This will allow us to specify element-type of SimpleClass for Object[ ] and SimpleInterface[ ].

Independently, issue 138 has been raised to allow the implementation to specify whether they support references to Object and SimpleInterface to be mapped, or whether a more specific type is needed in the metadata.

Craig Russell added a comment - 12/Nov/05 06:36 AM
The final issue raised in this JIRA report has been resolved.

Craig Russell made changes - 12/Nov/05 06:36 AM
Status Open [ 1 ] Closed [ 6 ]
Resolution Fixed [ 1 ]
Michael Bouschen added a comment - 23/Apr/06 02:43 AM
Reopened to set the Fix Version/s field to JDO 2 beta.

Michael Bouschen made changes - 23/Apr/06 02:43 AM
Resolution Fixed [ 1 ]
Status Closed [ 6 ] Reopened [ 4 ]
Michael Bouschen made changes - 23/Apr/06 02:46 AM
Resolution Fixed [ 1 ]
Fix Version/s JDO 2 beta [ 12310683 ]
Status Reopened [ 4 ] Closed [ 6 ]