コード例 #1
0
 public RedmineAttachment refreshItem(RedmineAttachment journal) throws SQLException {
   return refreshItem(journal.getConnectionId(), journal);
 }
コード例 #2
0
  public RedmineAttachment refreshItem(int connection_id, RedmineAttachment data)
      throws SQLException {
    if (data == null) return null;

    RedmineAttachment project = this.fetchById(connection_id, data.getAttachmentId());
    data.setConnectionId(connection_id);

    if (project.getId() == null) {
      this.insert(data);
    } else {
      data.setId(project.getId());

      if (project.getModified() == null) {
        project.setModified(new java.util.Date());
      }
      if (data.getModified() == null) {
        data.setModified(new java.util.Date());
      }
      if (!project.getModified().before(data.getModified())) {
        this.update(data);
      }
    }
    return data;
  }