Skip to content

Instantly share code, notes, and snippets.

@hieuwu
Created March 21, 2022 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hieuwu/c2b9d120b3030152253d3e392b309d36 to your computer and use it in GitHub Desktop.
Save hieuwu/c2b9d120b3030152253d3e392b309d36 to your computer and use it in GitHub Desktop.
Order dao
@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