Search in sources :

Example 6 with ObjectArrayMapping

use of org.eclipse.persistence.mappings.structures.ObjectArrayMapping in project eclipselink by eclipse-ee4j.

the class ORDescriptorTestSuite method tbl3Asserts.

protected void tbl3Asserts(ClassDescriptor tbl3Descriptor) {
    assertTrue("Wrong Java class name.  Expected [" + TBL3_DESCRIPTOR_JAVACLASSNAME + "] but was [" + tbl3Descriptor.getJavaClassName() + "]", tbl3Descriptor.getJavaClassName().equals(TBL3_DESCRIPTOR_JAVACLASSNAME));
    Vector<DatabaseMapping> mappings = tbl3Descriptor.getMappings();
    assertTrue("Wrong number of mappings.  Expected [1] but was [" + mappings.size() + "]", mappings.size() == 1);
    DatabaseMapping mapping = mappings.get(0);
    assertTrue("Incorrect mapping attribute name.  Expected [" + BaseDBWSBuilderHelper.ITEMS_MAPPING_ATTRIBUTE_NAME + "] but was [" + mapping.getAttributeName() + "]", mapping.getAttributeName().equals(BaseDBWSBuilderHelper.ITEMS_MAPPING_ATTRIBUTE_NAME));
    assertTrue("Incorrect mapping field name.  Expected [" + BaseDBWSBuilderHelper.ITEMS_MAPPING_FIELD_NAME + "] but was [" + mapping.getField().getName() + "]", mapping.getField().getName().equals(BaseDBWSBuilderHelper.ITEMS_MAPPING_FIELD_NAME));
    assertTrue("Incorrect mapping type.  Expected [AbstractCompositeCollection mapping] but was [" + mapping.getClass().getName() + "]", mapping.isAbstractCompositeCollectionMapping());
    ObjectArrayMapping oArrayMapping = (ObjectArrayMapping) mapping;
    assertTrue("Incorrect structure name.  Expected [" + TBL3_COMPATIBLETYPE + "] but was [" + oArrayMapping.getStructureName() + "]", oArrayMapping.getStructureName().equals(TBL3_COMPATIBLETYPE));
    assertTrue("Incorrect reference class name.  Expected [" + ARECORD_DESCRIPTOR_JAVACLASSNAME + "] but was [" + oArrayMapping.getReferenceClassName() + "]", oArrayMapping.getReferenceClassName().equals(ARECORD_DESCRIPTOR_JAVACLASSNAME));
}
Also used : DatabaseMapping(org.eclipse.persistence.mappings.DatabaseMapping) ObjectArrayMapping(org.eclipse.persistence.mappings.structures.ObjectArrayMapping)

Aggregations

ObjectArrayMapping (org.eclipse.persistence.mappings.structures.ObjectArrayMapping)6 DirectToFieldMapping (org.eclipse.persistence.mappings.DirectToFieldMapping)2 ObjectRelationalDataTypeDescriptor (org.eclipse.persistence.mappings.structures.ObjectRelationalDataTypeDescriptor)2 ObjectRelationalDatabaseField (org.eclipse.persistence.mappings.structures.ObjectRelationalDatabaseField)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 StringReader (java.io.StringReader)1 SQLException (java.sql.SQLException)1 DBWSModel (org.eclipse.persistence.dbws.DBWSModel)1 DBWSModelProject (org.eclipse.persistence.dbws.DBWSModelProject)1 XRServiceFactory (org.eclipse.persistence.internal.xr.XRServiceFactory)1 DatabaseMapping (org.eclipse.persistence.mappings.DatabaseMapping)1 ArrayMapping (org.eclipse.persistence.mappings.structures.ArrayMapping)1 StructureMapping (org.eclipse.persistence.mappings.structures.StructureMapping)1 NamespaceResolver (org.eclipse.persistence.oxm.NamespaceResolver)1 XMLContext (org.eclipse.persistence.oxm.XMLContext)1 XMLDescriptor (org.eclipse.persistence.oxm.XMLDescriptor)1 XMLField (org.eclipse.persistence.oxm.XMLField)1 XMLLogin (org.eclipse.persistence.oxm.XMLLogin)1 XMLUnmarshaller (org.eclipse.persistence.oxm.XMLUnmarshaller)1 XMLCompositeCollectionMapping (org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping)1