|
[
Permlink
| « Hide
]
Michelle Caisse added a comment - 19/Aug/05 07:07 AM
Mapping is messed up, needs to be redone.
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.
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 ? 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) ... 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
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. What metadata can be used so implementation can map this?
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. The final issue raised in this JIRA report has been resolved.
Reopened to set the Fix Version/s field to JDO 2 beta.
|
|||||||||||||||||||||||||||||||||||||||||||||||