Created
March 21, 2022 14:59
-
-
Save hieuwu/c2b9d120b3030152253d3e392b309d36 to your computer and use it in GitHub Desktop.
Order dao
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Dao | |
interface OrderDao { | |
//Get an order along with its line items by orderId | |
@Transaction | |
@Query("SELECT * FROM orders WHERE orderId = :id") | |
fun getById(id: String): Flow<OrderWithLineItems> | |
//Get an order by its status | |
@Transaction | |
@Query("SELECT * FROM orders WHERE status = :status LIMIT 1 ") | |
fun getCartWithLineItems(status: String): Flow<OrderWithLineItems> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment