JavaWeb项目开发案例精粹-第2章投票系统-005实体层
1.
1 package com.sanqing.bean; 2 /** 3 * 4 * 投票选项类 5 * 6 */ 7 public class VoteOption { 8 private int voteOptionID; //投票选项ID 9 private int voteID; //投票ID 10 private String voteOptionName; //投票选项名称 11 private int ticketNum; 12 public int getVoteOptionID() { 13 return voteOptionID; 14 } 15 public void setVoteOptionID(int voteOptionID) { 16 this.voteOptionID = voteOptionID; 17 } 18 public int getVoteID() { 19 return voteID; 20 } 21 public void setVoteID(int voteID) { 22 this.voteID = voteID; 23 } 24 public String getVoteOptionName() { 25 return voteOptionName; 26 } 27 public void setVoteOptionName(String voteOptionName) { 28 this.voteOptionName = voteOptionName; 29 } 30 public int getTicketNum() { 31 return ticketNum; 32 } 33 public void setTicketNum(int ticketNum) { 34 this.ticketNum = ticketNum; 35 } 36 }
2.
1 package com.sanqing.bean; 2 /** 3 * 4 * 投票类 5 * 6 */ 7 public class Vote { 8 private int voteID; //投票ID 9 private String voteName; //投票名称 10 private int channelID; //频道ID 11 public int getVoteID() { 12 return voteID; 13 } 14 public void setVoteID(int voteID) { 15 this.voteID = voteID; 16 } 17 public String getVoteName() { 18 return voteName; 19 } 20 public void setVoteName(String voteName) { 21 this.voteName = voteName; 22 } 23 public int getChannelID() { 24 return channelID; 25 } 26 public void setChannelID(int channelID) { 27 this.channelID = channelID; 28 } 29 }
3.
1 package com.sanqing.bean; 2 3 import java.util.List; 4 5 public class VoteResult { 6 private Vote vote; 7 private List<VoteOption> voteOptions; 8 public Vote getVote() { 9 return vote; 10 } 11 public void setVote(Vote vote) { 12 this.vote = vote; 13 } 14 public List<VoteOption> getVoteOptions() { 15 return voteOptions; 16 } 17 public void setVoteOptions(List<VoteOption> voteOptions) { 18 this.voteOptions = voteOptions; 19 } 20 }
4.
1 package com.sanqing.bean; 2 /** 3 * 4 * 投票频道类 5 * 6 */ 7 public class Channel { 8 private int channelID; //频道ID 9 private String channelName; //频道名称 10 public int getChannelID() { 11 return channelID; 12 } 13 public void setChannelID(int channelID) { 14 this.channelID = channelID; 15 } 16 public String getChannelName() { 17 return channelName; 18 } 19 public void setChannelName(String channelName) { 20 this.channelName = channelName; 21 } 22 23 }
You can do anything you set your mind to, man!