query updated.
Query updated.
Merge pull request #24 from memonwasim/reviewqueries

Update query to JDatabase format