import java.util.List;

/**
 * Created by nate on 4/10/16.
 */
public class Game extends Model {
    public int id;
    public String name;
    public float price;

    public List<Category> categories() {
        return null;
    }

    public List<Review> reviews() {
        return null;
    }
}

@@ -1,8 +1,128 @@
+import java.sql.PreparedStatement;%0Aimport java.sql.ResultSet;%0Aimport java.sql.SQLException;%0Aimport java.util.ArrayList;%0A
 import j
@@ -315,24 +315,698 @@
 egories() %7B%0A
+        try %7B%0A            List%3CCategory%3E categories = new ArrayList%3CCategory%3E();%0A            Category cat;%0A%0A            PreparedStatement s = c.prepareStatement(%0A                    %22SELECT id, name from game_category join category on id=category_id where game_id=?%22%0A            );%0A            s.setInt(1, id);%0A%0A            ResultSet rs = s.executeQuery();%0A            while (rs.next()) %7B%0A                cat = new Category();%0A                cat.id = rs.getInt(%22id%22);%0A                cat.name = rs.getString(%22name%22);%0A%0A                categories.add(cat);%0A            %7D%0A%0A            return categories;%0A        %7D catch (SQLException e) %7B%0A            e.printStackTrace();%0A    
         retu
@@ -1010,24 +1010,34 @@
 eturn null;%0A
+        %7D%0A
     %7D%0A%0A    p
@@ -1063,24 +1063,1731 @@
 reviews() %7B%0A
+        try %7B%0A            List%3CReview%3E reviews = new ArrayList%3C%3E();%0A            UserReview ur;%0A            CriticReview cr;%0A            User u;%0A%0A            PreparedStatement s = c.prepareStatement(%0A                    %22SELECT rating, text, real_name, profile_name, credit_card, level, phone, user.id%22 +%0A                            %22from user_review%22 +%0A                            %22join user on user.id=user_review.user_id%22 +%0A                            %22where game_id=?%22%0A            );%0A            s.setInt(1, id);%0A%0A            ResultSet rs = s.executeQuery();%0A            while (rs.next()) %7B%0A                ur = new UserReview();%0A                ur.rating = rs.getInt(%22id%22);%0A                ur.text = rs.getString(%22text%22);%0A                ur.game = this;%0A%0A                u = new User();%0A                ur.user = u;%0A                u.realName = rs.getString(%22real_name%22);%0A                u.creditCard = rs.getString(%22credit_card%22);%0A                u.level = rs.getInt(%22level%22);%0A                u.phone = rs.getString(%22phone%22);%0A                u.id = rs.getInt(%22user.id%22);%0A%0A                reviews.add(ur);%0A            %7D%0A%0A            s = c.prepareStatement(%22SELECT rating, text, company, link from critic_review where game_id=?%22);%0A            s.setInt(1, id);%0A%0A            rs = s.executeQuery();%0A            while (rs.next()) %7B%0A                cr = new CriticReview();%0A%0A                cr.game = this;%0A                cr.company = rs.getString(%22company%22);%0A                cr.rating = rs.getFloat(%22rating%22);%0A                cr.link = rs.getString(%22link%22);%0A%0A                reviews.add(cr);%0A            %7D%0A%0A            return reviews;%0A        %7D catch (SQLException e) %7B%0A            e.printStackTrace();%0A    
         retu
@@ -2791,20 +2791,30 @@
 eturn null;%0A
+        %7D%0A
     %7D%0A%7D%0A

Add query methods to game class