Last active
May 22, 2019 22:44
-
-
Save MwBakker/8efa9932ab6d6160d35af5b18f6bcf1c to your computer and use it in GitHub Desktop.
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
// get all components belonging to a rack | |
@Query("SELECT c.id, cc.name as category_name, c.rack_id, c.component_category_id, c.name, c.img_path, c.code, " + | |
" (SELECT COUNT(c.name) " + | |
" FROM rack r " + | |
" WHERE c.rack_id = : rackID ) as count " + | |
"FROM component c " + | |
"INNER JOIN component_category cc ON cc.id = c.component_category_id " + | |
"WHERE c.rack_id = :rackID and cc.id = c.component_category_id " + | |
"ORDER BY c.name ASC") | |
LiveData<List<Component>> getRackComponents(long rackID); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment