Example #1
0
 @Override
 public String getModifyStatement() {
   Topic topic = (Topic) this.getEntity();
   Timestamp ts = new Timestamp(topic.getDate().getTime());
   String statement =
       String.format(
           MODIFY_STATEMENT,
           topic.getUserId(),
           topic.getTitle(),
           topic.getContent(),
           topic.getReplyCount(),
           topic.getDiggCount(),
           ts.toString(),
           topic.getId());
   return statement;
 }
Example #2
0
 @Override
 public String getDeleteStatement() {
   Topic topic = (Topic) this.getEntity();
   String statement = "DELETE FROM Topic WHERE topicId = " + topic.getId();
   return statement;
 }