Skip to content

Commit 725dfe0

Browse files
committed
[MODFQMMGR-1037] Remove obsolete entity type properties
1 parent 219a985 commit 725dfe0

6 files changed

Lines changed: 0 additions & 45 deletions

File tree

src/main/java/org/folio/fqm/service/EntityTypeFlatteningService.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,8 @@ private EntityType getFlattenedEntityType(
126126
.description(originalEntityType.getDescription())
127127
._private(originalEntityType.getPrivate())
128128
.defaultSort(originalEntityType.getDefaultSort())
129-
.idView(originalEntityType.getIdView())
130-
.customFieldEntityTypeId(originalEntityType.getCustomFieldEntityTypeId())
131129
.labelAlias(originalEntityType.getLabelAlias())
132130
.groupByFields(originalEntityType.getGroupByFields())
133-
.sourceView(originalEntityType.getSourceView())
134-
.sourceViewExtractor(originalEntityType.getSourceViewExtractor())
135131
.crossTenantQueriesEnabled(originalEntityType.getCrossTenantQueriesEnabled())
136132
.filterConditions(originalEntityType.getFilterConditions())
137133
.additionalEcsConditions(originalEntityType.getAdditionalEcsConditions())
@@ -238,12 +234,6 @@ private EntityType getFlattenedEntityType(
238234
}
239235
}
240236

241-
if (flattenedEntityType.getSourceViewExtractor() != null) {
242-
flattenedEntityType.sourceViewExtractor(
243-
SourceUtils.injectSourceAliasIntoViewExtractor(flattenedEntityType.getSourceViewExtractor(), renamedAliases)
244-
);
245-
}
246-
247237
if (!CollectionUtils.isEmpty(flattenedEntityType.getFilterConditions())) {
248238
List<String> newFilterConditions = SourceUtils.injectSourceAliasIntoFilterConditions(
249239
flattenedEntityType.getFilterConditions(),

src/main/java/org/folio/fqm/service/EntityTypeValidationService.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,24 +61,6 @@ public void validateCustomEntityType(UUID entityTypeId, CustomEntityType customE
6161
if (customEntityType.getColumns() != null && !customEntityType.getColumns().isEmpty()) {
6262
throw new InvalidEntityTypeDefinitionException("Custom entity types must not contain columns", customEntityType);
6363
}
64-
if (customEntityType.getCustomFieldEntityTypeId() != null) {
65-
throw new InvalidEntityTypeDefinitionException(
66-
"Custom field entity type ID must not be defined for custom entity types",
67-
customEntityType
68-
);
69-
}
70-
if (customEntityType.getSourceView() != null) {
71-
throw new InvalidEntityTypeDefinitionException(
72-
"Custom entity types must not contain a sourceView property",
73-
customEntityType
74-
);
75-
}
76-
if (customEntityType.getSourceViewExtractor() != null) {
77-
throw new InvalidEntityTypeDefinitionException(
78-
"Custom entity types must not contain a sourceViewExtractor property",
79-
customEntityType
80-
);
81-
}
8264
if (Boolean.TRUE.equals(customEntityType.getCrossTenantQueriesEnabled())) {
8365
throw new InvalidEntityTypeDefinitionException(
8466
"Custom entity must not have cross-tenant queries enabled",

src/test/java/org/folio/fqm/repository/ResultSetRepositoryArrayTestDataProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public class ResultSetRepositoryArrayTestDataProvider implements MockDataProvide
5959
.valueGetter(":sourceAlias.testJsonbArrayField")
6060
))
6161
.name("TEST_ARRAY_ENTITY_TYPE")
62-
.fromClause("TEST_ARRAY_ENTITY_TYPE")
6362
.sources(List.of(
6463
new EntityTypeSourceDatabase()
6564
.type("db")

src/test/java/org/folio/fqm/repository/ResultSetRepositoryTestDataProvider.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public class ResultSetRepositoryTestDataProvider implements MockDataProvider {
4141
)
4242
.defaultSort(List.of(new EntityTypeDefaultSort().columnName(EntityTypeRepository.ID_FIELD_NAME)))
4343
.name("TEST_ENTITY_TYPE")
44-
.fromClause("TEST_ENTITY_TYPE")
4544
.sources(List.of(
4645
new EntityTypeSourceDatabase()
4746
.type("db")
@@ -62,7 +61,6 @@ public class ResultSetRepositoryTestDataProvider implements MockDataProvider {
6261
"id", "field1"
6362
)
6463
)
65-
.fromClause("TEST_GROUP_BY_ENTITY_TYPE")
6664
.sources(List.of(
6765
new EntityTypeSourceDatabase()
6866
.type("db")
@@ -87,7 +85,6 @@ public class ResultSetRepositoryTestDataProvider implements MockDataProvider {
8785
))
8886
.id("6b08439b-4f8e-4468-8046-ea620f5cfb74")
8987
.name("TEST_ENTITY_TYPE")
90-
.fromClause("TEST_ENTITY_TYPE")
9188
.sources(
9289
List.of(
9390
new EntityTypeSourceDatabase()

src/test/java/org/folio/fqm/service/EntityTypeFlatteningServiceTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,6 @@ void testFlattenSimpleEntityType() {
545545
)
546546
.sources(List.of(new EntityTypeSourceDatabase().type("db").alias("source1").target("source1_target")))
547547
.requiredPermissions(List.of("simple_permission1", "simple_permission2"))
548-
.sourceViewExtractor("\"source1\".some_view_extractor")
549548
.filterConditions(List.of("\"source1\".field1 != 'xyz'"))
550549
.putAdditionalProperty("isCustom", false);
551550

src/test/java/org/folio/fqm/service/EntityTypeValidationServiceTest.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,6 @@ static List<Arguments> customEntityTypeInvalidCases() {
198198
return List.of(
199199
Arguments.of(customETFactory(b -> b.version(null)), "Custom entity type must have _version=current"),
200200
Arguments.of(customETFactory(b -> b.version("old")), "Custom entity type must have _version=current"),
201-
Arguments.of(
202-
customETFactory(b -> b.sourceView("something")),
203-
"Custom entity types must not contain a sourceView property"
204-
),
205-
Arguments.of(
206-
customETFactory(b -> b.sourceViewExtractor("something")),
207-
"Custom entity types must not contain a sourceViewExtractor property"
208-
),
209-
Arguments.of(
210-
customETFactory(b -> b.customFieldEntityTypeId(BASE_VALID_CUSTOM_ENTITY_TYPE.getId())),
211-
"Custom field entity type ID must not be defined for custom entity types"
212-
),
213201
Arguments.of(customETFactory(b -> b.owner(null)), "Custom entity type must have an owner"),
214202
Arguments.of(customETFactory(b -> b.isCustom(null)), "Entity type .+ is not a custom entity type"),
215203
Arguments.of(customETFactory(b -> b.isCustom(false)), "Entity type .+ is not a custom entity type"),

0 commit comments

Comments
 (0)