Skip to content

Commit

Permalink
[FQTM-11] New entity type join model
Browse files Browse the repository at this point in the history
  • Loading branch information
ncovercash committed Jan 31, 2025
1 parent e59612b commit 38d35e2
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 73 deletions.
8 changes: 5 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>
<groupId>org.folio</groupId>
<artifactId>folio-query-tool-metadata</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>27.0.0</version>
<name>folio-query-tool-metadata</name>
<description>This is a library (jar) that provides the SPI for used by the Query tool and must be implemented by a
data provider,
Expand All @@ -18,7 +18,7 @@

<properties>
<java.version>17</java.version>
<openapi-generator.version>7.3.0</openapi-generator.version>
<openapi-generator.version>7.11.0</openapi-generator.version>
<maven-compat.version>3.8.7</maven-compat.version>
<yaml.file>${project.basedir}/src/main/resources/swagger.api/queryTool.yaml</yaml.file>
<lombok.version>1.18.24</lombok.version>
Expand Down Expand Up @@ -200,7 +200,9 @@
<modelsToGenerate>
<!-- the commas at the start and end of each line are load-bearing, as otherwise openapi-generator will include the newline/indentation as part of the model name -->
,errors,error,parameters,parameter,resultsetPage,
,entityType,field,entityTypeColumn,entityTypeRelation,entityTypeDefaultSort,sourceColumn,entityTypeSource,entityTypeSourceJoin,
,entityType,field,entityTypeColumn,entityTypeRelation,entityTypeDefaultSort,sourceColumn,
,entityTypeSource,entityTypeSourceBase,entityTypeSourceDatabase,entityTypeSourceDatabaseJoin,entityTypeSourceEntityType,
,join,joinCustom,joinEqualitySimple,joinEqualityCastUUID,
,entityDataType,arrayType,jsonbArrayType,dateType,objectType,enumType,booleanType,integerType,openUUIDType,stringType,numberType,rangedUUIDType,stringUUIDType,
,nestedObjectProperty,valueWithLabel,valueSourceApi,columnValues,columnValueGetter
,queryDetails,queryIdentifier,
Expand Down
17 changes: 17 additions & 0 deletions src/main/resources/swagger.api/queryTool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,14 @@ components:
schemas:
UUID:
$ref: schemas/common.json#/UUID

entityTypeSource:
$ref: schemas/entityTypeSource.json
entityTypeSourceDatabase:
$ref: schemas/entityTypeSourceDatabase.json
entityTypeSourceEntityType:
$ref: schemas/entityTypeSourceEntityType.json

entityType:
$ref: schemas/entityType.json#/EntityType
entityDataType:
Expand Down Expand Up @@ -386,6 +394,15 @@ components:
fqmMigrateResponse:
$ref: schemas/fqmMigrateResponse.json

join:
$ref: schemas/field-joins/join.json
joinCustom:
$ref: schemas/field-joins/joinCustom.json
joinEqualitySimple:
$ref: schemas/field-joins/joinEqualitySimple.json
joinEqualityCastUUID:
$ref: schemas/field-joins/joinEqualityCastUUID.json

queryResultIds:
type: array
items:
Expand Down
10 changes: 2 additions & 8 deletions src/main/resources/swagger.api/schemas/entityType.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"sources": {
"type": "array",
"items": {
"$ref": "entityTypeSource.json"
"$ref": "./entityTypeSource.json"
},
"default": []
},
Expand All @@ -102,12 +102,6 @@
"default": []
}
},
"required": [
"id",
"name",
"root",
"private"
]
"required": ["id", "name", "root", "private"]
}
}

13 changes: 12 additions & 1 deletion src/main/resources/swagger.api/schemas/entityTypeColumn.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,21 @@
"essential": {
"description": "Indicates if a column is crucial to the definition of an entity type",
"type": "boolean"
},
"joinsTo": {
"description": "A set of columns which this column may be joined to",
"type": "array",
"items": {
"$ref": "./field-joins/join.json"
}
},
"originalEntityTypeId": {
"description": "[Internal only, not for definitions] The simplest entity type that this column is derived from",
"type": "string",
"format": "uuid"
}
},
"required": []
}
]
}

62 changes: 25 additions & 37 deletions src/main/resources/swagger.api/schemas/entityTypeSource.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,31 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Entity Type Source",
"description": "Definition for an entity type source, which provide a set of fields and can be joined with other sources",
"type": "object",
"properties": {
"type": {
"description": "Type of source. Valid values are db, entity-type.",
"type": "string"
},
"target": {
"description": "Target from which values are extracted",
"type": "string"
},
"alias": {
"description": "Alias of this source to be used in query",
"type": "string"
},
"id": {
"description": "Id of the entity type for this source (entity-type type only)",
"type": "string"
},
"join": {
"description": "Object describing how this entity type source can be joined to another source",
"$ref": "entityTypeSourceJoin.json"
},
"flattened": {
"description": "Whether this source has already been flattened",
"type": "boolean"
},
"useIdColumns": {
"description": "Whether to use the idColumns of this source as idColumns for the enclosing entity type",
"type": "boolean"
},
"essentialOnly": {
"description": "Indicates that only critical columns for core functionality should be inherited, excluding non-essential columns",
"type": "boolean"
"allOf": [
{
"type": "object",
"discriminator": {
"propertyName": "type",
"mapping": {
"db": "#/components/schemas/entityTypeSourceDatabase",
"entity-type": "#/components/schemas/entityTypeSourceEntityType"
}
},
"properties": {
"type": {
"description": "Type of source. Valid values are db, entity-type",
"type": "string"
},
"alias": {
"description": "Alias of this source to be used in query/later joins",
"type": "string"
},
"joinedViaEntityType": {
"description": "[Internal use only, should not be included in definitions] The owning entity's alias, if this source's joining is handled by a parent entity in a cross-entity join",
"type": "string"
}
},
"required": ["type", "alias"]
}
},
"required": [
"type",
"alias"
]
}
24 changes: 0 additions & 24 deletions src/main/resources/swagger.api/schemas/entityTypeSourceJoin.json

This file was deleted.

0 comments on commit 38d35e2

Please sign in to comment.