businessObjectFormat.setId(ID);
businessObjectFormat.setId(ID);
businessObjectFormat.setId(ID);
businessObjectFormat.setId(ID);
businessObjectFormat.setId(businessObjectFormatEntity.getId()); businessObjectFormat.setNamespace(businessObjectFormatEntity.getBusinessObjectDefinition().getNamespace().getCode()); businessObjectFormat.setBusinessObjectDefinitionName(businessObjectFormatEntity.getBusinessObjectDefinition().getName());
businessObjectFormat.setId(businessObjectFormatEntity.getId()); businessObjectFormat.setNamespace(businessObjectFormatEntity.getBusinessObjectDefinition().getNamespace().getCode()); businessObjectFormat.setBusinessObjectDefinitionName(businessObjectFormatEntity.getBusinessObjectDefinition().getName());
expectedBusinessObjectFormat.setId(resultBusinessObjectFormat.getId()); expectedBusinessObjectFormat.setBusinessObjectFormatVersion(SECOND_FORMAT_VERSION); expectedBusinessObjectFormat.setSchema(updatedSchema);
@Test public void testCreateBusinessObjectFormatInitialVersionExistsWithSchemaAdditiveSchemaChangesColumnDescriptionUpdated() { // Create relative database entities. businessObjectFormatServiceTestHelper.createTestDatabaseEntitiesForBusinessObjectFormatTesting(); // Create an initial format schema. Schema initialSchema = new Schema( Arrays.asList(new SchemaColumn(COLUMN_NAME, COLUMN_DATA_TYPE, COLUMN_SIZE, NO_COLUMN_REQUIRED, NO_COLUMN_DEFAULT_VALUE, COLUMN_DESCRIPTION)), Arrays.asList(new SchemaColumn(COLUMN_NAME_2, COLUMN_DATA_TYPE_2, COLUMN_SIZE, NO_COLUMN_REQUIRED, NO_COLUMN_DEFAULT_VALUE, COLUMN_DESCRIPTION_2)), SCHEMA_NULL_VALUE_BACKSLASH_N, SCHEMA_DELIMITER_PIPE, SCHEMA_ESCAPE_CHARACTER_BACKSLASH, PARTITION_KEY_GROUP); // Create the updated format schema having modified column descriptions for both regular and partition columns. Schema updatedSchema = (Schema) initialSchema.clone(); updatedSchema.getColumns().get(0).setDescription(COLUMN_DESCRIPTION_3); updatedSchema.getPartitions().get(0).setDescription(COLUMN_DESCRIPTION_4); // Create an initial version of the business object format. BusinessObjectFormat initialBusinessObjectFormat = businessObjectFormatService.createBusinessObjectFormat( new BusinessObjectFormatCreateRequest(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, COLUMN_NAME_2, FORMAT_DESCRIPTION, FORMAT_DOCUMENT_SCHEMA, NO_ATTRIBUTES, NO_ATTRIBUTE_DEFINITIONS, initialSchema)); // Create a second version of the business object format with the schema columns having updated descriptions. BusinessObjectFormat resultBusinessObjectFormat = businessObjectFormatService.createBusinessObjectFormat( new BusinessObjectFormatCreateRequest(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, COLUMN_NAME_2, FORMAT_DESCRIPTION, FORMAT_DOCUMENT_SCHEMA, NO_ATTRIBUTES, NO_ATTRIBUTE_DEFINITIONS, updatedSchema)); // Validate the returned object. BusinessObjectFormat expectedBusinessObjectFormat = (BusinessObjectFormat) initialBusinessObjectFormat.clone(); expectedBusinessObjectFormat.setId(resultBusinessObjectFormat.getId()); expectedBusinessObjectFormat.setBusinessObjectFormatVersion(SECOND_FORMAT_VERSION); expectedBusinessObjectFormat.setSchema(updatedSchema); assertEquals(expectedBusinessObjectFormat, resultBusinessObjectFormat); }
expectedBusinessObjectFormatChild.setId(resultBusinessObjectFormatChildV1.getId()); expectedBusinessObjectFormatChild.setBusinessObjectFormatVersion(resultBusinessObjectFormatChildV1.getBusinessObjectFormatVersion()); expectedBusinessObjectFormatChild.setBusinessObjectFormatParents(resultBusinessObjectFormatChildV1.getBusinessObjectFormatParents()); assertEquals(resultBusinessObjectFormatParentV2.getBusinessObjectFormatChildren().size(), 1); BusinessObjectFormat expectedBusinessObjectParent = resultBusinessObjectFormatV0; expectedBusinessObjectParent.setId(resultBusinessObjectFormatParentV2.getId()); expectedBusinessObjectParent.setBusinessObjectFormatVersion(resultBusinessObjectFormatParentV2.getBusinessObjectFormatVersion()); expectedBusinessObjectParent.setBusinessObjectFormatChildren(resultBusinessObjectFormatParentV2.getBusinessObjectFormatChildren());
expectedBusinessObjectFormat.setId(businessObjectFormat.getId()); expectedBusinessObjectFormat.setNamespace(BDEF_NAMESPACE); expectedBusinessObjectFormat.setBusinessObjectDefinitionName(BDEF_NAME);
expectedBusinessObjectFormat.setId(resultBusinessObjectFormat.getId()); expectedBusinessObjectFormat.setBusinessObjectFormatVersion(SECOND_FORMAT_VERSION); expectedBusinessObjectFormat.setSchema(expectedSchema);
expectedBusinessObjectFormat.setId(resultBusinessObjectFormat.getId()); expectedBusinessObjectFormat.setNamespace(BDEF_NAMESPACE); expectedBusinessObjectFormat.setBusinessObjectDefinitionName(BDEF_NAME);
sourceId = this.getId(); int copyId = strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, true); copy.setId(copyId); } else { if (idShouldBeCopiedAndSet == Boolean.FALSE) {
sourceId = this.getId(); int copyId = strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, true); copy.setId(copyId); } else { if (idShouldBeCopiedAndSet == Boolean.FALSE) {
sourceId = this.getId(); int copyId = strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, true); copy.setId(copyId); } else { if (idShouldBeCopiedAndSet == Boolean.FALSE) {