Skip to content

Commit

Permalink
Naming improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Dec 4, 2024
1 parent 00f15e9 commit f32b51a
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class DatabaseEntitiesRepository(context: Context, dbPath: String) : EntitiesRep
return emptyList()
}

return queryWithAttachedRowId(list).foldAndClose {
return queryEqualWithAttachedRowId(list).foldAndClose {
mapCursorRowToEntity(
it,
it.getInt(ROW_ID)
Expand Down Expand Up @@ -213,7 +213,7 @@ class DatabaseEntitiesRepository(context: Context, dbPath: String) : EntitiesRep
return null
}

return queryWithAttachedRowId(
return queryEqualWithAttachedRowId(
list,
selectionColumn = EntitiesTable.COLUMN_ID,
selectionArg = id
Expand Down Expand Up @@ -241,7 +241,7 @@ class DatabaseEntitiesRepository(context: Context, dbPath: String) : EntitiesRep
return null
}

return queryWithAttachedRowId(
return queryEqualWithAttachedRowId(
list,
selectionColumn = EntitiesTable.COLUMN_LABEL,
selectionArg = label
Expand All @@ -264,15 +264,15 @@ class DatabaseEntitiesRepository(context: Context, dbPath: String) : EntitiesRep
}

return if (propertyExists) {
queryWithAttachedRowId(
queryEqualWithAttachedRowId(
list,
selectionColumn = EntitiesTable.getPropertyColumn(property),
selectionArg = value
).foldAndClose {
mapCursorRowToEntity(it, it.getInt(ROW_ID))
}
} else if (value == "") {
queryWithAttachedRowId(list).foldAndClose {
queryEqualWithAttachedRowId(list).foldAndClose {
mapCursorRowToEntity(it, it.getInt(ROW_ID))
}
} else {
Expand Down Expand Up @@ -300,7 +300,7 @@ class DatabaseEntitiesRepository(context: Context, dbPath: String) : EntitiesRep
}
}

private fun queryWithAttachedRowId(list: String): Cursor {
private fun queryEqualWithAttachedRowId(list: String): Cursor {
return databaseConnection.withConnection {
readableDatabase
.rawQuery(
Expand All @@ -315,7 +315,7 @@ class DatabaseEntitiesRepository(context: Context, dbPath: String) : EntitiesRep
}
}

private fun queryWithAttachedRowId(
private fun queryEqualWithAttachedRowId(
list: String,
selectionColumn: String,
selectionArg: String?,
Expand Down

0 comments on commit f32b51a

Please sign in to comment.