diff --git a/src/main/java/org/avniproject/etl/dto/MediaDTO.java b/src/main/java/org/avniproject/etl/dto/MediaDTO.java index c79cfa6..c45e237 100644 --- a/src/main/java/org/avniproject/etl/dto/MediaDTO.java +++ b/src/main/java/org/avniproject/etl/dto/MediaDTO.java @@ -3,5 +3,5 @@ import java.net.URL; -public record MediaDTO(String uuid, String subjectFirstName, String subjectLastName, String url, String conceptName, URL signedUrl, String thumbnailUrl, URL signedThumbnailUrl, String subjectTypeName, String programEnrolment, String encounterTypeName, String lastModifiedDateTime, String createdDateTime, String syncConcept1Name, String syncConcept2Name, String syncParameterValue1, String syncParameterValue2, Object address){ +public record MediaDTO(String uuid, String subjectFirstName, String subjectLastName, String url, String conceptName, URL signedUrl, String thumbnailUrl, URL signedThumbnailUrl, String subjectTypeName, String programEnrolment, String encounterTypeName, String lastModifiedDateTime, String createdDateTime, String syncConcept1Name, String syncConcept2Name, String syncParameterValue1, String syncParameterValue2, Object address, long entityId){ } diff --git a/src/main/java/org/avniproject/etl/repository/service/MediaTableRepositoryService.java b/src/main/java/org/avniproject/etl/repository/service/MediaTableRepositoryService.java index a016992..c6ddd21 100644 --- a/src/main/java/org/avniproject/etl/repository/service/MediaTableRepositoryService.java +++ b/src/main/java/org/avniproject/etl/repository/service/MediaTableRepositoryService.java @@ -50,7 +50,8 @@ public MediaDTO setMediaDto(ResultSet rs) { rs.getString("sync_parameter_key2"), rs.getString("sync_parameter_value1"), rs.getString("sync_parameter_value2"), - rs.getString("address") + rs.getString("address"), + rs.getLong("entity_id") ); } catch (SQLException e) { throw new Error("Error:" + e.getMessage()); diff --git a/src/main/resources/sql/api/searchMedia.sql.st b/src/main/resources/sql/api/searchMedia.sql.st index d2c5f42..bd50a0c 100644 --- a/src/main/resources/sql/api/searchMedia.sql.st +++ b/src/main/resources/sql/api/searchMedia.sql.st @@ -17,7 +17,8 @@ SELECT media.id as id, media.encounter_type_name as encounter_type_name, media.program_name as program_name, media.concept_name as concept_name, - row_to_json(address.*) as address + row_to_json(address.*) as address, + media.entity_id as entity_id FROM .media media JOIN .address address ON address.id = media.address_id