@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; }
@Override public String getDeleteStatement() { Topic topic = (Topic) this.getEntity(); String statement = "DELETE FROM Topic WHERE topicId = " + topic.getId(); return statement; }