Whitney Martinez 5 years ago
parent
commit
b8d6ca7199

+ 1
- 0
src/main/java/io/zipcoder/tc_spring_poll_application/repositories/VoteRepository.java View File

12
             "AND v.OPTION_ID = o.OPTION_ID", nativeQuery = true)
12
             "AND v.OPTION_ID = o.OPTION_ID", nativeQuery = true)
13
     public Iterable<Vote> findVotesByPoll(Long pollId);
13
     public Iterable<Vote> findVotesByPoll(Long pollId);
14
 
14
 
15
+
15
     public Iterable<Vote>findById(Long pollId);
16
     public Iterable<Vote>findById(Long pollId);
16
 
17
 
17
 }
18
 }

+ 2
- 0
src/main/resources/import.sql View File

1
+
1
 insert into poll (poll_id, question) values (1, 'What is your favorite color?');
2
 insert into poll (poll_id, question) values (1, 'What is your favorite color?');
2
 insert into option (option_id, option_value, poll_id) values (1, 'Red', 1);
3
 insert into option (option_id, option_value, poll_id) values (1, 'Red', 1);
4
+insert into option (option_id, option_value, poll_id) values (2, 'Blue', 2);