From 74429ccf37a10d0552f45fe9105a74774bb2c917 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Fri, 18 Aug 2023 00:59:27 +0530 Subject: [PATCH 1/2] Rename .java to .kt --- .../library/dao/{FormResourceDAO.java => FormResourceDAO.kt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/dao/{FormResourceDAO.java => FormResourceDAO.kt} (100%) diff --git a/openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/dao/FormResourceDAO.java b/openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/dao/FormResourceDAO.kt similarity index 100% rename from openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/dao/FormResourceDAO.java rename to openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/dao/FormResourceDAO.kt From 202ffb9d3c74c769eb55a13f6dbaa37745df7cd2 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Fri, 18 Aug 2023 00:59:28 +0530 Subject: [PATCH 2/2] AC-1099: Migrate FormResourceDAO to Kotlin --- .../library/dao/FormResourceDAO.kt | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/dao/FormResourceDAO.kt b/openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/dao/FormResourceDAO.kt index 219894346..bfe0b5dd0 100644 --- a/openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/dao/FormResourceDAO.kt +++ b/openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/dao/FormResourceDAO.kt @@ -11,22 +11,19 @@ * * Copyright (C) OpenMRS, LLC. All Rights Reserved. */ +package com.openmrs.android_sdk.library.dao -package com.openmrs.android_sdk.library.dao; - -import java.util.List; - -import androidx.room.Dao; -import androidx.room.Insert; -import androidx.room.Query; - -import com.openmrs.android_sdk.library.databases.entities.FormResourceEntity; +import androidx.room.Dao +import androidx.room.Insert +import androidx.room.Query +import com.openmrs.android_sdk.library.databases.entities.FormResourceEntity /** * The interface Form resource dao. */ @Dao -public interface FormResourceDAO { +interface FormResourceDAO { + /** * Gets form resource by name. * @@ -34,7 +31,7 @@ public interface FormResourceDAO { * @return the form resource by name */ @Query("SELECT * FROM forms WHERE name = :name") - FormResourceEntity getFormResourceByName(String name); + fun getFormResourceByName(name: String): FormResourceEntity /** * Gets form resource list. @@ -42,7 +39,7 @@ public interface FormResourceDAO { * @return the form resource list */ @Query("SELECT * FROM forms") - List getFormResourceList(); + fun getFormResourceList(): List /** * Gets form by uuid. @@ -51,13 +48,13 @@ public interface FormResourceDAO { * @return the form by uuid */ @Query("SELECT * FROM forms WHERE uuid = :uuid") - FormResourceEntity getFormByUuid(String uuid); + fun getFormByUuid(uuid: String): FormResourceEntity /** * Delete all forms. */ @Query("DELETE FROM forms") - void deleteAllForms(); + fun deleteAllForms() /** * Add form resource. @@ -65,5 +62,5 @@ public interface FormResourceDAO { * @param formResourceEntity the form resource entity */ @Insert - void addFormResource(FormResourceEntity formResourceEntity); -} + fun addFormResource(formResourceEntity: FormResourceEntity) +} \ No newline at end of file