4

I m having a databaseView code like this.

@DatabaseView("SELECT * FROM Product")
data class ProductDatabaseView(
    var productCode: String? = "",
    var productName: String? = "",
    var longDescription: String? = "",
    var productUom: String? = "",
    var customerCode: String? = "",
    var price: String? = ""
)

And I wanna pass some value as we do in our DAO like this.

@DatabaseView("SELECT * FROM Product WHERE priceListCode = :priceListCode")
data class ProductDatabaseView(
    var productCode: String? = "",
    var productName: String? = "",
    var longDescription: String? = "",
    var productUom: String? = "",
    var customerCode: String? = "",
    var price: String? = ""
)

Is it able to pass value like this or is there any other option available with the help of View.

1 Answers1

2

To my knowledge, no you can't pass argument to @DatabaseView. They work the same way as in sqlite which doesn't allow parameters in views.

Biscuit
  • 4,840
  • 4
  • 26
  • 54