Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1575 - implementation of ingest relationships and GET Relationships API #1592

Merged
merged 71 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
3914a3e
1536 - MVP for look-ups
Vladysl Dec 6, 2023
a6156ac
Merge branch 'main' into 1536
AndreyNenashev Dec 6, 2023
2444b8b
1536 - MVP for look-ups
Vladysl Dec 7, 2023
4db6a55
1536 - update spec
Vladysl Dec 8, 2023
819dbcd
1536 - update spec and first implementation of adding data to custom …
Vladysl Dec 11, 2023
a542367
feature(fe): tab and router for master-data tab and lookup tables page
AndreyNenashev Dec 6, 2023
37fa832
feature(fe): lookup tables page
AndreyNenashev Dec 6, 2023
12bffe8
feature(fe): lookup table input search component
AndreyNenashev Dec 7, 2023
66ea1b0
feature(fe): lookup table form
AndreyNenashev Dec 7, 2023
c164ce6
feature(fe): lookup tables management
AndreyNenashev Dec 8, 2023
cdae0b8
feature(fe): link to lookup table`s data entity
AndreyNenashev Dec 8, 2023
aa28c99
feature(fe): rename tableName to name
AndreyNenashev Dec 11, 2023
73e6bf1
1536 implementation of update lookup table and it's columns
Vladysl Dec 13, 2023
4d9660a
feature(fe): add column button if dataset is lookup table
AndreyNenashev Dec 14, 2023
5faf71b
feature(fe): add column form
AndreyNenashev Dec 14, 2023
6bc9f40
feature(chore): adjust fe to the new openapi
AndreyNenashev Dec 14, 2023
581f0b4
1536 added lookup table to data Entities details and Added remove APIS
Vladysl Dec 15, 2023
1dfa721
1536 added lookup table to data Entities details and Added remove APIS
Vladysl Dec 15, 2023
ea0f9ed
1536 added remove lookup table data and get lookupTableDefinition API's
Vladysl Dec 15, 2023
f8f8021
feature(fe): create column form
AndreyNenashev Dec 15, 2023
4b4e238
feature(fe): column deletion
AndreyNenashev Dec 15, 2023
0925b73
feature(fe): delete column button
AndreyNenashev Dec 15, 2023
3eafc05
feature(fe): edit column form
AndreyNenashev Dec 15, 2023
8549e51
1536 added default values for is_nullable and
Vladysl Dec 15, 2023
4fd8f6d
1536 - implementation of lookups APIs
Vladysl Dec 18, 2023
6f6ab05
1536 - implementation of getLookupTable API
Vladysl Dec 20, 2023
1ea86d2
1536 - added unit test and ordering by id for table lookup definitions
Vladysl Dec 21, 2023
3183f17
1536 - added unit test
Vladysl Dec 21, 2023
dd86ecb
1536 - is_nullable default value is true
Vladysl Dec 22, 2023
333d919
1536 - remove ENUM type
Vladysl Dec 22, 2023
cbefe6c
1536 - added row_id to LookupTableRow
Vladysl Dec 26, 2023
c063864
refactoring(fe): shared SearchInput component
AndreyNenashev Dec 20, 2023
f7a901e
refactoring(fe): query examples list component
AndreyNenashev Dec 20, 2023
bc2e6f1
feature(fe): show reference data componeny
AndreyNenashev Dec 21, 2023
e8638e4
feature(fe): show dataset data
AndreyNenashev Dec 22, 2023
04ea601
feature(fe): delete reference data row
AndreyNenashev Dec 26, 2023
75bf156
feature(fe): use table instead of flexbox for unkown table data
AndreyNenashev Dec 27, 2023
fbbd4d8
feature(fe): render form
AndreyNenashev Dec 29, 2023
a262514
feature(fe): create reference data row form action
AndreyNenashev Dec 29, 2023
939b376
1536 - update demo.yaml
Vladysl Jan 4, 2024
5a934f4
1536 - updated /api/referencedata/table/{lookup_table_id}/data/{row_i…
Vladysl Jan 10, 2024
df401b4
add .vscode in .gitignore
AndreyNenashev Jan 8, 2024
e723590
feature(fe): table row cell component
AndreyNenashev Jan 8, 2024
f35ac7a
feature(fe): force reload virtualized table
AndreyNenashev Jan 9, 2024
5b01408
feature(fe): update row
AndreyNenashev Jan 9, 2024
b1f518e
fix(fe): fix table cell rendering
AndreyNenashev Jan 9, 2024
065d19a
fix(fe): fix table cell rendering
AndreyNenashev Jan 9, 2024
6ffc015
chore(fe): minor refactoring
AndreyNenashev Jan 9, 2024
e39547a
chore(fe): fix inputs glitches
AndreyNenashev Jan 9, 2024
e228ee5
feature(fe): decompose table cell into different components
AndreyNenashev Jan 10, 2024
6e388c7
feature(fe): simplify DatasetDataTableRowCellDate component
AndreyNenashev Jan 10, 2024
280c402
chore(fe): edit table row
AndreyNenashev Jan 10, 2024
a848939
chore(fe): fix create row form
AndreyNenashev Jan 10, 2024
e7b54d9
1576 - MVP implementation of ingest relationships
Vladysl Jan 12, 2024
e5619fa
1576 - MVP implementation of ingest relationships
Vladysl Jan 12, 2024
ae4ad82
1576 - implementation of ingest relationships and GET Relationships API
Vladysl Jan 18, 2024
687a15a
Merge remote-tracking branch 'origin/main' into 1575
Vladysl Jan 19, 2024
dfca26e
fix merge conflicts
Vladysl Jan 19, 2024
48611e3
1576 - implementation of ingest relationships API and GET Relationshi…
Vladysl Jan 22, 2024
b87a118
1576 - implementation of ingest relationships API and GET Relationshi…
Vladysl Jan 23, 2024
b23b1a4
1576 - implementation of ingest relationships API and GET Relationshi…
Vladysl Jan 23, 2024
7d202f9
1576 - implementation of ingest relationships API and GET Relationshi…
Vladysl Jan 23, 2024
c9cd80c
1576 - implementation of ingest relationships API and GET Relationshi…
Vladysl Jan 23, 2024
9cf0126
1576 - implementation of ingest relationships API and GET Relationshi…
Vladysl Jan 23, 2024
3a7667e
1576 - implementation of ingest relationships API and GET Relationshi…
Vladysl Jan 23, 2024
4476757
1576 - implementation of ingest relationships API and GET Relationshi…
Vladysl Jan 29, 2024
9fdc740
1576 - implementation of ingest relationships API and GET Relationshi…
Vladysl Jan 29, 2024
155d62b
1576 - implementation of ingest relationships API and GET Relationshi…
Vladysl Jan 29, 2024
32f20cc
1576 - implementation of ingest relationships API and GET Relationshi…
Vladysl Jan 30, 2024
58f8a43
Merge remote-tracking branch 'origin/main' into 1575
Vladysl Jan 30, 2024
00daede
1576 - rename params
Vladysl Jan 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
spring-webflux = '6.0.9'
reactor-extra = '3.5.1'
micrometer-registry-prometheus = '1.9.0'
ingestion-contract-server = '0.1.32'
ingestion-contract-server = '0.1.38'
oddrn-generator-java = '0.1.21'
odd-integration-manifests = '0.0.6'
apache-collections = '4.4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ public ConnectionPool connectionFactory(final DataSourceProperties dataSourcePro
return new ConnectionPool(builder.build());
}

@Bean(destroyMethod = "dispose")
@Qualifier("customConnectionPool")
@Bean(name = "customConnectionPool", destroyMethod = "dispose")
public ConnectionPool databaseClientForCustomSchema(
@Value("${spring.custom-datasource.url}") final String url,
@Value("${spring.custom-datasource.username}") final String username,
Expand Down Expand Up @@ -83,8 +82,7 @@ public DatabaseClient databaseClient(final ConnectionFactory schema1ConnectionFa
return DatabaseClient.create(schema1ConnectionFactory);
}

@Bean
@Qualifier("customDataClient")
@Bean(name = "customDataClient")
public DatabaseClient databaseClientCustomTables(
@Qualifier("customConnectionPool") final ConnectionFactory connectionFactory) {
return DatabaseClient.create(connectionFactory);
Expand All @@ -96,8 +94,7 @@ public ReactiveTransactionManager reactiveTransactionManager(final ConnectionFac
return new R2dbcTransactionManager(connectionFactory);
}

@Bean
@Qualifier("customTransactionManager")
@Bean(name = "customTransactionManager")
public ReactiveTransactionManager reactiveCustomTransactionManager(
@Qualifier("customConnectionPool") final ConnectionFactory connectionFactory) {
return new R2dbcTransactionManager(connectionFactory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import lombok.RequiredArgsConstructor;
import org.opendatadiscovery.oddplatform.api.contract.api.DataSetApi;
import org.opendatadiscovery.oddplatform.api.contract.model.DataEntityRelationshipList;
import org.opendatadiscovery.oddplatform.api.contract.model.DataSetStructure;
import org.opendatadiscovery.oddplatform.api.contract.model.DataSetVersionDiffList;
import org.opendatadiscovery.oddplatform.api.contract.model.RelationshipsType;
import org.opendatadiscovery.oddplatform.service.DatasetVersionService;
import org.opendatadiscovery.oddplatform.service.RelationshipsService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;
Expand All @@ -14,6 +17,7 @@
@RequiredArgsConstructor
public class DatasetController implements DataSetApi {
private final DatasetVersionService datasetVersionService;
private final RelationshipsService relationshipsService;

@Override
public Mono<ResponseEntity<DataSetStructure>> getDataSetStructureByVersionId(
Expand Down Expand Up @@ -44,4 +48,12 @@ public Mono<ResponseEntity<DataSetVersionDiffList>> getDataSetStructureDiff(fina
return datasetVersionService.getDatasetVersionDiff(dataEntityId, firstVersionId, secondVersionId)
.map(ResponseEntity::ok);
}

@Override
public Mono<ResponseEntity<DataEntityRelationshipList>> getDataSetRelationships(final Long dataEntityId,
final RelationshipsType type,
final ServerWebExchange exchange) {
return relationshipsService.getRelationsByDatasetId(dataEntityId, type)
.map(ResponseEntity::ok);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package org.opendatadiscovery.oddplatform.controller;

import lombok.RequiredArgsConstructor;
import org.opendatadiscovery.oddplatform.api.contract.api.RelationshipApi;
import org.opendatadiscovery.oddplatform.api.contract.model.DataEntityERDRelationshipDetails;
import org.opendatadiscovery.oddplatform.api.contract.model.DataEntityGraphRelationshipDetails;
import org.opendatadiscovery.oddplatform.api.contract.model.DataEntityRelationshipList;
import org.opendatadiscovery.oddplatform.api.contract.model.RelationshipsType;
import org.opendatadiscovery.oddplatform.service.RelationshipsService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

@RestController
@RequiredArgsConstructor
public class RelationshipController implements RelationshipApi {
private final RelationshipsService relationshipsService;

@Override
public Mono<ResponseEntity<DataEntityRelationshipList>> getRelationships(final Integer page,
final Integer size,
final RelationshipsType type,
final String query,
final ServerWebExchange exchange) {
return relationshipsService.getRelationships(page, size, type, query)
.map(ResponseEntity::ok);
}

@Override
public Mono<ResponseEntity<DataEntityERDRelationshipDetails>>
getERDRelationshipById(final Long relationshipId,
final ServerWebExchange exchange) {
return relationshipsService.getERDRelationshipById(relationshipId)
.map(ResponseEntity::ok);
}

@Override
public Mono<ResponseEntity<DataEntityGraphRelationshipDetails>>
getGraphRelationshipById(final Long relationshipId,
final ServerWebExchange exchange) {
return relationshipsService.getGraphRelationshipById(relationshipId)
.map(ResponseEntity::ok);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.ML_MODEL_ARTIFACT;
import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.ML_MODEL_INSTANCE;
import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.ML_MODEL_TRAINING;
import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.RELATIONSHIP;
import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.TABLE;
import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.VECTOR_STORE;
import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.VIEW;
Expand All @@ -45,7 +46,8 @@ public enum DataEntityClassDto {
DATA_QUALITY_TEST_RUN(5, JOB_RUN),
DATA_CONSUMER(6, Set.of(ML_MODEL_ARTIFACT, DASHBOARD)),
DATA_INPUT(7, API_CALL),
DATA_ENTITY_GROUP(8, Set.of(ML_EXPERIMENT, DAG, DATABASE_SERVICE, API_SERVICE, KAFKA_SERVICE, DOMAIN));
DATA_ENTITY_GROUP(8, Set.of(ML_EXPERIMENT, DAG, DATABASE_SERVICE, API_SERVICE, KAFKA_SERVICE, DOMAIN)),
DATA_RELATIONSHIP(9, RELATIONSHIP);

private static final Map<Integer, DataEntityClassDto> MAP = Arrays.stream(DataEntityClassDto.values())
.collect(Collectors.toMap(DataEntityClassDto::getId, identity()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public enum DataEntityTypeDto {
KAFKA_SERVICE(21),
DOMAIN(22),
VECTOR_STORE(23),
LOOKUP_TABLE(24);
LOOKUP_TABLE(24),
RELATIONSHIP(25);

private static final Map<Integer, DataEntityTypeDto> MAP = Arrays
.stream(DataEntityTypeDto.values())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.opendatadiscovery.oddplatform.dto;

import lombok.Builder;
import org.opendatadiscovery.oddplatform.model.tables.pojos.DataEntityPojo;
import org.opendatadiscovery.oddplatform.model.tables.pojos.ErdRelationshipDetailsPojo;
import org.opendatadiscovery.oddplatform.model.tables.pojos.GraphRelationshipPojo;
import org.opendatadiscovery.oddplatform.model.tables.pojos.RelationshipsPojo;

@Builder
public record RelationshipDetailsDto(DataEntityPojo dataEntityRelationship,
RelationshipsPojo relationshipPojo,
DataEntityPojo sourceDataEntity,
DataEntityPojo targetDataEntity,
ErdRelationshipDetailsPojo erdRelationshipDetailsPojo,
GraphRelationshipPojo graphRelationshipPojo) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.opendatadiscovery.oddplatform.dto;

import lombok.Builder;
import org.opendatadiscovery.oddplatform.model.tables.pojos.DataEntityPojo;
import org.opendatadiscovery.oddplatform.model.tables.pojos.RelationshipsPojo;

@Builder
public record RelationshipDto(DataEntityPojo dataEntityRelationship,
RelationshipsPojo relationshipPojo,
DataEntityPojo sourceDataEntity,
DataEntityPojo targetDataEntity) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.opendatadiscovery.oddplatform.dto;

import java.util.Arrays;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import lombok.Getter;

import static java.util.function.Function.identity;

public enum RelationshipStatusDto {
ACTIVE(1),
DELETED(2);

@Getter
private final short id;

RelationshipStatusDto(final int id) {
this.id = (short) id;
}

private static final Map<Short, DataEntityStatusDto> MAP = Arrays
.stream(DataEntityStatusDto.values())
.collect(Collectors.toMap(DataEntityStatusDto::getId, identity()));

public static Optional<DataEntityStatusDto> findById(final short id) {
return Optional.ofNullable(MAP.get(id));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.opendatadiscovery.oddplatform.dto;

public enum RelationshipTypeDto {
ERD,
GRAPH
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
import lombok.NoArgsConstructor;
import org.opendatadiscovery.oddplatform.dto.DataEntityClassDto;
import org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto;
import org.opendatadiscovery.oddplatform.dto.RelationshipTypeDto;
import org.opendatadiscovery.oddplatform.ingestion.contract.model.DataSetFieldEnumValue;
import org.opendatadiscovery.oddplatform.model.tables.pojos.DatasetFieldPojo;
import org.opendatadiscovery.oddplatform.model.tables.pojos.ErdRelationshipDetailsPojo;
import org.opendatadiscovery.oddplatform.model.tables.pojos.GraphRelationshipPojo;

@Data
@Builder
Expand All @@ -36,6 +39,7 @@ public class DataEntityIngestionDto {
protected DataQualityTestIngestionDto dataQualityTest;
protected DataInputIngestionDto dataInput;
protected DataEntityGroupDto dataEntityGroup;
protected DataRelationshipDto dataRelationshipDto;

public record DataSetIngestionDto(String parentDatasetOddrn,
List<DatasetFieldIngestionDto> fieldList,
Expand Down Expand Up @@ -63,4 +67,14 @@ public record DatasetFieldIngestionDto(DatasetFieldPojo field,
List<DataSetFieldEnumValue> enumValues,
Map<String, Object> metadata) {
}

public record DataRelationshipDto(String sourceOddrn,
String targetOddrn,
RelationshipTypeDto relationshipType,
DataRelationshipDetailsDto details) {
}

public record DataRelationshipDetailsDto(ErdRelationshipDetailsPojo erdRelationshipDetailsPojo,
GraphRelationshipPojo graphRelationshipPojo) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public EnrichedDataEntityIngestionDto(final long id,
ingestionDto.sourceCreatedAt, ingestionDto.sourceUpdatedAt, ingestionDto.entityClasses, ingestionDto.type,
ingestionDto.metadata, ingestionDto.tags, ingestionDto.specificAttributesJson, ingestionDto.dataSet,
ingestionDto.dataTransformer, ingestionDto.dataConsumer, ingestionDto.dataQualityTest,
ingestionDto.dataInput, ingestionDto.dataEntityGroup);
ingestionDto.dataInput, ingestionDto.dataEntityGroup, ingestionDto.dataRelationshipDto);

this.id = id;
this.previousVersionPojo = previousVersionPojo;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.opendatadiscovery.oddplatform.mapper;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import org.opendatadiscovery.oddplatform.api.contract.model.ERDRelationshipDetails;
import org.opendatadiscovery.oddplatform.api.contract.model.ERDRelationshipPairs;
import org.opendatadiscovery.oddplatform.model.tables.pojos.ErdRelationshipDetailsPojo;
import org.springframework.stereotype.Component;
import org.thymeleaf.util.ArrayUtils;

@Component
public class ErdRelationshipMapper {
public ERDRelationshipDetails mapPojoToDetails(final ErdRelationshipDetailsPojo erd) {
return new ERDRelationshipDetails()
.erdRelationshipId(erd.getId())
.fieldsPairs(mapPairs(erd.getSourceDatasetFieldOddrn(), erd.getTargetDatasetFieldOddrn()))
.isIdentifying(erd.getIsIdentifying())
.cardinality(erd.getCardinality());
}

private List<ERDRelationshipPairs> mapPairs(final String[] source, final String[] target) {
if (ArrayUtils.isEmpty(source)) {
return null;
}

return IntStream.range(0, source.length).mapToObj(i -> new ERDRelationshipPairs()
.sourceDatasetFieldOddrn(source[i])
.targetDatasetFieldOddrn(target[i])).collect(Collectors.toList());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package org.opendatadiscovery.oddplatform.mapper;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectReader;
import java.util.List;
import java.util.Map;
import org.jooq.JSONB;
import org.opendatadiscovery.oddplatform.api.contract.model.GraphRelationshipAttributes;
import org.opendatadiscovery.oddplatform.api.contract.model.GraphRelationshipDetails;
import org.opendatadiscovery.oddplatform.model.tables.pojos.GraphRelationshipPojo;
import org.springframework.stereotype.Component;

@Component
public class GraphRelationshipMapper {
public GraphRelationshipDetails mapPojoToDetails(final GraphRelationshipPojo pojo) {
if (pojo == null) {
return null;
}

return new GraphRelationshipDetails()
.graphRelationshipId(pojo.getId())
.isDirected(pojo.getIsDirected())
.attributes(mapGraphAttributes(pojo.getSpecificAttributes()));
}

private List<GraphRelationshipAttributes> mapGraphAttributes(final JSONB specificAttributes) {
if (specificAttributes == null) {
return List.of();
}

final ObjectReader reader = new ObjectMapper().readerFor(Map.class);

try {
final Map<String, String> map = reader.readValue(specificAttributes.data());

return map.entrySet().stream()
.map(item -> new GraphRelationshipAttributes()
.name(item.getKey())
.value(item.getValue()))
.toList();
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package org.opendatadiscovery.oddplatform.mapper;

import lombok.RequiredArgsConstructor;
import org.opendatadiscovery.oddplatform.api.contract.model.DataEntityERDRelationshipDetails;
import org.opendatadiscovery.oddplatform.api.contract.model.DataEntityGraphRelationshipDetails;
import org.opendatadiscovery.oddplatform.api.contract.model.DataEntityRelationshipType;
import org.opendatadiscovery.oddplatform.dto.RelationshipDetailsDto;
import org.opendatadiscovery.oddplatform.dto.RelationshipTypeDto;
import org.springframework.stereotype.Component;

@RequiredArgsConstructor
@Component
public class RelationshipDetailsMapper {
private final ErdRelationshipMapper erdRelationshipMapper;
private final GraphRelationshipMapper graphRelationshipMapper;

public DataEntityERDRelationshipDetails mapToDataEntityERDRelationshipDetails(
final RelationshipDetailsDto relationshipDetailsDto) {
return new DataEntityERDRelationshipDetails()
.id(relationshipDetailsDto.dataEntityRelationship().getId())
.name(relationshipDetailsDto.dataEntityRelationship().getExternalName())
.oddrn(relationshipDetailsDto.dataEntityRelationship().getOddrn())
.sourceDatasetOddrn(relationshipDetailsDto.relationshipPojo().getSourceDatasetOddrn())
.targetDatasetOddrn(relationshipDetailsDto.relationshipPojo().getTargetDatasetOddrn())
.sourceDataEntityId(
relationshipDetailsDto.sourceDataEntity() != null ? relationshipDetailsDto.sourceDataEntity().getId() :
null)
.targetDataEntityId(
relationshipDetailsDto.targetDataEntity() != null ? relationshipDetailsDto.targetDataEntity().getId() :
null)
.type(RelationshipTypeDto.ERD.name().equals(relationshipDetailsDto.relationshipPojo().getRelationshipType())
? DataEntityRelationshipType.ERD
: DataEntityRelationshipType.GRAPH)
.erdRelationship(
erdRelationshipMapper.mapPojoToDetails(relationshipDetailsDto.erdRelationshipDetailsPojo()));
}

public DataEntityGraphRelationshipDetails mapToDataEntityGraphRelationshipDetails(
final RelationshipDetailsDto relationshipDetailsDto) {
return new DataEntityGraphRelationshipDetails()
.id(relationshipDetailsDto.dataEntityRelationship().getId())
.name(relationshipDetailsDto.dataEntityRelationship().getExternalName())
.oddrn(relationshipDetailsDto.dataEntityRelationship().getOddrn())
.sourceDatasetOddrn(relationshipDetailsDto.relationshipPojo().getSourceDatasetOddrn())
.targetDatasetOddrn(relationshipDetailsDto.relationshipPojo().getTargetDatasetOddrn())
.sourceDataEntityId(
relationshipDetailsDto.sourceDataEntity() != null ? relationshipDetailsDto.sourceDataEntity().getId() :
null)
.targetDataEntityId(
relationshipDetailsDto.targetDataEntity() != null ? relationshipDetailsDto.targetDataEntity().getId() :
null)
.type(RelationshipTypeDto.ERD.name().equals(relationshipDetailsDto.relationshipPojo().getRelationshipType())
? DataEntityRelationshipType.ERD
: DataEntityRelationshipType.GRAPH)
.graphRelationship(
graphRelationshipMapper.mapPojoToDetails(relationshipDetailsDto.graphRelationshipPojo()));
}
}
Loading
Loading