businessObjectFormat.setSchema(schema); schema.setNullValue(businessObjectFormatEntity.getNullValue()); schema.setDelimiter(businessObjectFormatEntity.getDelimiter());
businessObjectFormat.setSchema(schema); schema.setNullValue(businessObjectFormatEntity.getNullValue()); schema.setDelimiter(businessObjectFormatEntity.getDelimiter());
expectedBusinessObjectFormat.setId(resultBusinessObjectFormat.getId()); expectedBusinessObjectFormat.setBusinessObjectFormatVersion(SECOND_FORMAT_VERSION); expectedBusinessObjectFormat.setSchema(updatedSchema); assertEquals(expectedBusinessObjectFormat, resultBusinessObjectFormat);
@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); }
new Attribute(configurationHelper.getProperty(ConfigurationValue.BUSINESS_OBJECT_FORMAT_ATTRIBUTE_NAME_RELATIONAL_TABLE_NAME), relationalTableName))); expectedBusinessObjectFormat.setSchema(expectedSchema); expectedBusinessObjectFormat.setAllowNonBackwardsCompatibleChanges(true);
expectedBusinessObjectFormat.setId(resultBusinessObjectFormat.getId()); expectedBusinessObjectFormat.setBusinessObjectFormatVersion(SECOND_FORMAT_VERSION); expectedBusinessObjectFormat.setSchema(expectedSchema);
new Attribute(configurationHelper.getProperty(ConfigurationValue.BUSINESS_OBJECT_FORMAT_ATTRIBUTE_NAME_RELATIONAL_TABLE_NAME), relationalTableName))); expectedBusinessObjectFormat.setSchema(expectedSchema); expectedBusinessObjectFormat.setAllowNonBackwardsCompatibleChanges(true);
sourceSchema = this.getSchema(); Schema copySchema = ((Schema) strategy.copy(LocatorUtils.property(locator, "schema", sourceSchema), sourceSchema, (this.schema!= null))); copy.setSchema(copySchema); } else { if (schemaShouldBeCopiedAndSet == Boolean.FALSE) {
sourceSchema = this.getSchema(); Schema copySchema = ((Schema) strategy.copy(LocatorUtils.property(locator, "schema", sourceSchema), sourceSchema, (this.schema!= null))); copy.setSchema(copySchema); } else { if (schemaShouldBeCopiedAndSet == Boolean.FALSE) {
sourceSchema = this.getSchema(); Schema copySchema = ((Schema) strategy.copy(LocatorUtils.property(locator, "schema", sourceSchema), sourceSchema, (this.schema!= null))); copy.setSchema(copySchema); } else { if (schemaShouldBeCopiedAndSet == Boolean.FALSE) {